← Back to all fixes
AWS assume role fails with AccessDenied
The Issue
`aws sts assume-role --role-arn arn:aws:iam::123:role/MyRole` returns AccessDenied.
Root Cause
The IAM entity calling AssumeRole is not listed in the role's trust policy, or the entity's permission policy does not include `sts:AssumeRole`.
How to Fix
Check the target role's Trust Policy — the calling account/user/service must be in `Principal`Check the caller's IAM policy includes `sts:AssumeRole` for the target role ARNIf cross-account: both the trust policy (in target account) and the permission policy (in source account) must be setVerify you are using the correct role ARN (exact match, no typos)Use CloudTrail to see the exact denied API call and which policy blocked it