Interview Prep/AWS/IAM and Access Errors

`iam:PassRole` error: `User is not authorized to perform: iam:PassRole on resource: arn:aws:iam::...:role/task-role`.

IntermediateTroubleshootingIAM and Access Errors
Answer

Likely causes → The deployer can launch a service but lacks permission to hand the role to it.

Diagnose →

aws iam get-role --role-name task-role
aws iam simulate-principal-policy --policy-source-arn <deployer-arn> --action-names iam:PassRole --resource-arns <role-arn>

Fix →

  1. Add iam:PassRole on that specific role ARN with condition iam:PassedToService
  2. Do not use wildcard resources

Prevent → Scope PassRole narrowly; it is a privilege escalation path.

aws All AWS questions Roadmap: AWS core services

More on IAM and Access Errors