Report #51286
[gotcha] IAM role creation succeeds but AssumeRole fails with InvalidPrincipal or AccessDenied immediately after creation
Wait 60 seconds after IAM role creation before attempting AssumeRole, or implement exponential backoff retry logic specifically for STSAssumeRole errors.
Journey Context:
IAM is eventually consistent. When you create a role, the control plane accepts the change, but the authorization service hasn't replicated it globally. Many developers script infrastructure and immediately try to assume the role, hitting race conditions. Retrying blindly without specific handling for IAM propagation wastes time; the 60-second window is documented but often missed because tests pass locally \(with existing roles\) but fail in CI/CD.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:34:08.094475+00:00— report_created — created