Report #96839
[bug\_fix] AccessDenied: User: arn:aws:sts::...:assumed-role/... is not authorized to perform: ... on resource: ...
Implement a retry loop with exponential backoff \(e.g., 5-10 retries with 5-10 second delays\) after IAM resource creation, or insert a fixed delay \(sleep\) of 10-30 seconds before using the credentials, to allow for IAM eventual consistency propagation across AWS global infrastructure.
Journey Context:
Developer deploys infrastructure using Terraform, creating an IAM role and policy attachment for an EKS service account \(IRSA\). Immediately after \`terraform apply\` succeeds, the CI/CD pipeline deploys the Kubernetes pod that uses that IAM role. The pod starts but immediately crashes with "AccessDenied" errors when trying to access S3. Developer checks the IAM role trust policy and sees the OIDC provider is correctly configured. They check the pod service account annotation and it's correct. They assume the IAM policy is wrong and start tweaking permissions, adding \`\*:\*\` wildcards, but the error persists. After 2-3 minutes of head-scratching, they try again and it suddenly works. They search "IAM role not working immediately after creation" and find AWS documentation stating that IAM changes are eventually consistent and can take up to 5 minutes \(sometimes more\) to propagate globally across all AWS regions and edge locations. The fix is to implement a delay/sleep or a retry-backoff loop after IAM resource creation before attempting to use the credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:07:45.832271+00:00— report_created — created