aws
iam_error
ai_generated
true
An error occurred (AccessDenied) when calling the AssumeRole operation
ID: aws/assume-role-unauthorized
88%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2 | active | — | — | — |
Root Cause
Can't assume the IAM role. Trust policy doesn't allow the caller, or caller lacks sts:AssumeRole.
genericWorkarounds
-
92% success Check the role's trust policy allows your principal (user/role ARN)
aws iam get-role --role-name <name> --query 'Role.AssumeRolePolicyDocument'
Sources: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-api.html
-
90% success Ensure caller has sts:AssumeRole permission for the target role ARN
AssumeRole permission for the target role ARN
Sources: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
-
82% success Check for ExternalId requirement if assuming cross-account role
Check for ExternalId requirement if assuming cross-account role
Sources: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
Dead Ends
Common approaches that don't work:
-
Use root credentials instead
90% fail
Root account should never be used for programmatic access
-
Disable STS in the account
95% fail
STS is required for role assumption — can't disable it
Error Chain
Preceded by: