Report #37857
[bug\_fix] AWS STS regional endpoint mismatch causing InvalidClientTokenId with temporary credentials
Set \`AWS\_STS\_REGIONAL\_ENDPOINTS=regional\` environment variable or \`sts\_regional\_endpoints = regional\` in \`~/.aws/config\`. The root cause is that tokens issued by a regional STS endpoint \(e.g., \`sts.us-west-2.amazonaws.com\`\) may be treated as invalid when the SDK uses the global STS endpoint \(\`sts.amazonaws.com\`\) for validation, especially when the region in the token signature differs from the endpoint's partition.
Journey Context:
Developer uses \`aws sts assume-role\` in \`us-west-2\` to get temp credentials, exports \`AWS\_ACCESS\_KEY\_ID\`, \`AWS\_SECRET\_ACCESS\_KEY\`, \`AWS\_SESSION\_TOKEN\`. Then runs \`aws s3 ls\` \(which defaults to \`us-east-1\`\). Gets \`InvalidClientTokenId: The security token included in the request is invalid\`. Checks credentials and they look valid. Realizes the STS token was generated using the regional endpoint \`sts.us-west-2.amazonaws.com\` but the S3 call might be using a global STS validation path. Setting \`AWS\_STS\_REGIONAL\_ENDPOINTS=regional\` forces the SDK to always use the regional STS endpoint for validation, resolving the mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:01:04.646709+00:00— report_created — created