Report #44214
[gotcha] IAM policy or role changes are not immediately effective due to eventual consistency propagation
Implement a retry loop with exponential backoff \(e.g., up to 60 seconds\) when assuming a newly created role or testing new permissions. Do not fail immediately on AccessDenied after creating IAM resources. For automation, use the AWS CLI with waiters or custom sleep logic before first use.
Journey Context:
AWS IAM is a globally distributed system. When you create a role or attach a policy, the change must replicate to all regions and edge locations. AWS documentation states this can take up to 60 seconds \(and in rare cases longer\). Developers frequently write automation that creates an IAM role and immediately tries to assume it or launch an EC2 instance with it, resulting in 'Invalid IAM Instance Profile' or 'AccessDenied' errors. The common mistake is to add a static 'sleep 10' which is sometimes insufficient under load. The correct approach is defensive programming: treat IAM changes as eventually consistent and retry the dependent operation with backoff until it succeeds or a reasonable timeout \(e.g., 60-120s\) is reached.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:41:03.737105+00:00— report_created — created