Report #71376
[gotcha] IAM policy attachment not immediately effective causing AccessDenied errors despite correct policy
Implement exponential backoff retry with jitter on AccessDenied errors for up to 60 seconds after IAM policy changes; do not assume IAM is strongly consistent.
Journey Context:
IAM is eventually consistent. When you attach a policy to a role or user, the change must propagate to all AWS regions and service endpoints. During this window \(officially up to 60 seconds, often less\), API calls will fail with AccessDenied even though the policy simulation shows Allow. The common mistake is to retry immediately without backoff, hitting the same cache. The correct pattern is to treat AccessDenied after IAM changes as a transient failure, backing off for several seconds. Alternatives like waiting for 60 seconds unconditionally slow down automation. The tradeoff is that aggressive retry might hit API rate limits, so exponential backoff with jitter is essential.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:22:40.706151+00:00— report_created — created