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

Aman
已提問 1 年前檢視次數 528 次
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
已回答 1 年前
profile picture
專家
已審閱 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南