Report #11369
[bug\_fix] The security token included in the request is expired
Refresh the temporary credentials by re-invoking the STS AssumeRole or GetSessionToken API call, or configure the SDK to use a credential provider chain that automatically refreshes expired session tokens before they expire. The root cause is that STS temporary credentials contain a hard Expiration timestamp; once passed, the AWS signature validation rejects the request.
Journey Context:
You are running a long-lived ETL pipeline on an EC2 instance that assumes a cross-account role via STS AssumeRole. The job runs fine for exactly one hour, then every subsequent S3 putObject fails with 'ExpiredToken'. You check the instance metadata and the attached instance profile is fine, but you realize you explicitly called sts:AssumeRole at the start of the script and cached the returned AccessKeyId, SecretKey, and SessionToken in environment variables. The SDK cannot refresh them because you bypassed the default credential provider chain by setting AWS\_ACCESS\_KEY\_ID explicitly. You verify by checking the expiration field in the cached credentials and see it is indeed one hour old. By removing the manual env var injection and instead relying on the SDK's default credential chain with an assume-role provider configuration \(or by implementing a custom credential provider that refreshes the token before expiry\), the pipeline sustains beyond the one-hour mark because the client renegotiates the STS AssumeRole call automatically using the instance profile's long-term credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:12:22.672788+00:00— report_created — created