Interview Prep/AWS/IAM and Access Errors

`User: arn:aws:sts::111111111111:assumed-role/dev/bob is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::222222222222:role/deploy`. Why?

IntermediateTroubleshootingIAM and Access Errors
Answer

Likely causes → Caller lacks an sts:AssumeRole allow, or the target trust policy excludes the caller, or an SCP denies it.

Diagnose →

aws iam get-role --role-name deploy --query Role.AssumeRolePolicyDocument
aws iam list-role-policies --role-name dev
aws organizations list-policies-for-target --target-id 111111111111 --filter SERVICE_CONTROL_POLICY

Fix →

  1. Add allow on the target ARN to the caller's policy
  2. Fix the trust policy principal
  3. Remove blocking SCP conditions

Prevent → Keep a trust-policy template in IaC and test with a CI assume-role smoke test.

aws All AWS questions Roadmap: AWS core services

More on IAM and Access Errors