What it means
Assuming a role needs two things: the caller allowed to call sts:AssumeRole on the role, and the role's trust policy listing the caller as a principal (with any conditions met, such as MFA or external ID).
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The trust policy names another principal, or the wrong account
Check:
aws iam get-role --role-name <role> --query Role.AssumeRolePolicyDocument
Fix: Add the caller's ARN (or its account) as the Principal.
2. A condition isn't met (MFA, ExternalId, source)
Check:
Read the Condition block in the trust policy
Fix: Meet the condition (pass --serial-number/--token-code or --external-id).
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
Open the labNo account needed for your first tries.
Related errors
- AccessDenied: User is not authorized to perform: s3:GetObject
No policy allows the call, or one explicitly denies it.