Report #47361
[gotcha] AWS IAM policy changes not immediately effective causing AccessDenied
Implement exponential backoff retry with jitter \(using AWS SDK Standard or Adaptive retry mode\) for 5-10 seconds after IAM mutations, or explicitly poll GetRole/GetPolicy until the change is visible before proceeding
Journey Context:
IAM is a globally distributed system with eventual consistency. When you create a role, attach a policy, or update trust relationships, the change must propagate to all AWS regions and edge locations. Immediately attempting to assume the role or use the credentials results in 'AccessDenied' or 'InvalidPrincipal' errors that look like policy syntax errors. Common mistakes include adding static sleep\(10\) which slows pipelines and is still flaky, or retrying too aggressively hitting API limits. The AWS SDK's built-in Standard retry mode with exponential backoff is designed for exactly these transient propagation delays, treating the initial AccessDenied as a retryable condition without hardcoded waits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:58:42.244440+00:00— report_created — created