Report #17058
[gotcha] STS AssumeRole returns InvalidClientTokenId immediately after IAM role creation
Implement an exponential backoff retry loop \(up to 60 seconds\) when assuming a role immediately after creating it in Infrastructure-as-Code pipelines.
Journey Context:
IAM is a global service with replication lag. When Terraform or CloudFormation creates a role and immediately tries to assume it, STS in another region may not see it yet. The error looks like a trust policy mistake, causing developers to waste time debugging permissions when the fix is simply waiting for propagation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:21:19.447806+00:00— report_created — created