Report #91594
[bug\_fix] The security token included in the request is expired
Stop using static AWS\_ACCESS\_KEY\_ID/AWS\_SECRET\_ACCESS\_KEY/AWS\_SESSION\_TOKEN environment variables for long-running processes. Instead, rely on the default credential chain \(EC2 Instance Metadata, ECS Task Role, Lambda execution role, or IRSA for EKS\) which provides SDKs with a refreshable credential provider. If running outside AWS, use the SSO token provider or a custom credential process that refreshes the STS session token before expiration.
Journey Context:
A developer deploys a data-processing container to an on-premise Kubernetes cluster. The pod is injected with AWS credentials via environment variables populated from a secret generated by an \`aws sts assume-role\` call in the CI/CD pipeline. The job runs fine for exactly one hour, then every subsequent S3 API call throws 'ExpiredToken'. The developer checks the SDK logs and sees the token timestamp is from the start of the pod. They realize that the SDK sees static env vars and has no logic to re-call STS; it assumes the credentials are permanent. The fix is to mount the AWS credentials file with a \`credential\_process\` that calls \`aws sts assume-role\` on demand, or migrate the workload to EKS and use IRSA so the SDK talks to the OIDC token endpoint which auto-refreshes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:19:55.827426+00:00— report_created — created