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 Risposta
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
con risposta un anno fa
profile picture
ESPERTO
verificato un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande