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 Answer
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
answered a year ago
profile picture
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions