Report #101545
[gotcha] AWS IAM role or policy changes are not immediately visible, causing AssumeRole or authorization failures seconds after creation
After creating or attaching an IAM policy, poll or retry the dependent operation with exponential backoff before treating it as a failure. In IaC, add explicit dependencies and use provider waiters rather than assuming a successful API call means the permission is globally enforced.
Journey Context:
IAM is a globally distributed service with caching and replication. A role or policy can return success from the control plane but not yet be visible to the service that evaluates it. Terraform and CDK pipelines commonly create a role and immediately reference it from a Lambda or EC2, hitting AccessDenied/InvalidPrincipal. Hardcoded sleeps are brittle; AWS SDKs and providers have built-in retry helpers. Designing for retry also protects against regional propagation delays.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:02:15.032639+00:00— report_created — created