A SysOps administrator is using an IAM user account to deploy an AWS Lambda function that processes messages from an Amazon SQS queue. The administrator has already created a custom IAM execution role named LambdaSQSProcessorRole with all necessary permissions for the function. However, when the administrator attempts to create the Lambda function and associate it with this role, the operation fails with an AccessDenied error. Which of the following actions will resolve this issue?
- AModify the trust policy of the LambdaSQSProcessorRole to allow the administrator's IAM user to perform the sts:AssumeRole action.
- BAttach an IAM policy to the administrator's IAM user that allows the sts:AssumeRole action on the LambdaSQSProcessorRole resource.
- Attach an IAM policy to the administrator's IAM user that allows the iam:PassRole action on the LambdaSQSProcessorRole resource.Cevap
- DModify the permissions boundary of the LambdaSQSProcessorRole to include the sts:AssumeRole action for the administrator's IAM user.
Cevap
Attach an IAM policy to the administrator's IAM user that allows the iam:PassRole action on the LambdaSQSProcessorRole resource.
The correct action is to attach an IAM policy to the administrator's IAM user that allows the iam:PassRole action. In AWS, when an IAM user or role configures a service to run under a specific execution role, they must have the iam:PassRole permission on that target role resource. Without this, the service cannot receive the role, resulting in an AccessDenied error.
Adım Adım Çözüm
Anahtar Kavram
IAM PassRole Permission