IAM role/policy specific to a single lambda

0

Hi Team, I have created a IAM role where i have provided lambda basic execution policy and assume/trust policy. I need to restrict this role to get accessed by other resources and just allow a single lambda function to accept. Kindly provide an solution for this problem

1개 답변
4

I think what you are asking is to allow lambda to assume this role and only THAT lambda? in that case here is an example of trust relationship.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "aws:SourceArn": "arn:aws:lambda:<region>:<account-id>:function:<lambda-function-name>"
        }
      }
    }
  ]
}
profile pictureAWS
Niko
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠