Report #12960
[bug\_fix] The security token included in the request is expired \(ExpiredTokenException\)
Root cause: STS AssumeRole returns temporary credentials valid for a limited duration \(default 1 hour\). When these expire, all API calls fail. The fix is to implement a credential provider that automatically refreshes the token before expiration by re-calling AssumeRole, or use the AWS SDK's built-in STSAssumeRoleCredentialProvider which handles caching and refresh automatically. Do not hardcode temporary credentials in environment variables.
Journey Context:
Developer deploys a long-running data pipeline using credentials obtained from \`aws sts assume-role\`. Initially, jobs succeed, but exactly 60 minutes later, every AWS API call fails with \`ExpiredTokenException\`. Developer checks IAM policies and trusts relationships, wasting hours verifying permissions. They eventually notice the \`Expiration\` field in the original STS response. Realizing they stored the \`AccessKeyId\`, \`SecretAccessKey\`, and \`SessionToken\` in environment variables at startup, they understand these are static temporary credentials. The fix requires refactoring to use the AWS SDK's \`STSAssumeRoleCredentialsProvider\` which automatically calls AssumeRole before the 1-hour expiry window, caching new credentials transparently.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:23:02.663582+00:00— report_created — created