Report #9711
[gotcha] AssumeRole fails with 'Invalid principal' or 'Role not found' immediately after role creation
Implement exponential backoff retries \(up to 30 seconds\) when assuming a role immediately after creation, or use AWS CloudFormation / Terraform waiters to ensure propagation before proceeding.
Journey Context:
IAM resources exhibit eventual consistency. When you create a role and immediately attempt to assume it \(e.g., in automation scripts\), AWS may not have propagated the role to all regions/edges. Common mistakes include immediate sequential API calls without retries, or assuming the failure is permanent. While adding sleeps works, exponential backoff is more robust. The tradeoff is execution time vs. reliability. Note this is distinct from STS credential validity, which is a separate concern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:50:21.427659+00:00— report_created — created