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 Antwort
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
beantwortet vor einem Jahr
profile picture
EXPERTE
überprüft vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen