Report #24896
[bug\_fix] User: arn:aws:sts::ACCOUNT:assumed-role/CALLER-ROLE/SESSION is not authorized to perform: iam:PassRole on resource: arn:aws:iam::ACCOUNT:role/TARGET-ROLE
Attach an IAM policy to the calling user or role \(CALLER-ROLE\) that explicitly allows the \`iam:PassRole\` action on the target role's ARN. The policy must include: 'Effect': 'Allow', 'Action': 'iam:PassRole', 'Resource': 'arn:aws:iam::ACCOUNT:role/TARGET-ROLE'. Optionally add a 'Condition' key restricting the service \(e.g., 'StringEquals': \{'iam:PassedToService': 'lambda.amazonaws.com'\}\).
Journey Context:
You are deploying a new AWS Lambda function via Terraform or AWS CLI using a CI/CD pipeline that assumes a deployment role. The Terraform apply fails with 'Error: error creating Lambda Function: AccessDeniedException: ... is not authorized to perform: iam:PassRole'. You check the Lambda execution role \(TARGET-ROLE\) and it has the correct trust policy allowing lambda.amazonaws.com. You check the deployment role \(CALLER-ROLE\) and it has full Lambda permissions \(\*\). You realize that AWS IAM requires explicit permission to 'pass' a role to a service. This is a security boundary to prevent privilege escalation: a user with Lambda create permissions could otherwise attach an admin role to a Lambda they control. You add an inline policy to the deployment role allowing \`iam:PassRole\` specifically for the Lambda execution role ARN. The deployment succeeds because IAM now explicitly authorizes the principal to delegate the role to the Lambda service.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:11:42.371050+00:00— report_created — created