Report #11281
[gotcha] AWS IAM policy changes not taking effect immediately causing sporadic AccessDenied errors
Implement exponential backoff retry logic specifically for AccessDenied errors on fresh IAM deployments; do not assume immediate consistency even if \`get-policy\` returns the update.
Journey Context:
Developers apply a policy and immediately test, getting sporadic AccessDenied errors that look like policy syntax errors. They then spend hours debugging the JSON policy when the issue is IAM's eventual consistency \(up to 60\+ seconds\). The trap is assuming that \`aws iam get-role\` showing the policy means it's effective. The right call is to treat AccessDenied on fresh IAM changes as a transient retryable error for the first 2 minutes, using backoff to avoid hammering the API, and designing deployment pipelines to account for this window rather than failing immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:54:17.081506+00:00— report_created — created