Report #63823
[gotcha] IAM role assumption fails with InvalidPrincipal immediately after creation due to propagation delay
Implement exponential backoff retry \(max 5 retries, starting at 1s\) on assume-role failures. Alternatively, wait 10-15 seconds after creation before first assume. Do not retry on explicit permission denials \(distinct from propagation errors\)
Journey Context:
Automation scripts create a role and immediately call sts:AssumeRole, receiving 'Invalid principal' or 'Access denied' despite correct trust policy. This is IAM's eventual consistency across global regions; the trust policy update takes time to propagate to all STS endpoints. Developers often add static sleep\(10\) which wastes time or omit retry causing flaky pipelines. Alternative: Use IAM service-linked roles which are pre-provisioned. Why: IAM is a global service with distributed state; absolute consistency would require global locks, sacrificing availability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:36:47.699762+00:00— report_created — created