Report #16570
[gotcha] STS tokens fail in opt-in regions \(e.g., ap-east-1\) but work in standard regions
Always use regional STS endpoints \(sts.\{region\}.amazonaws.com\) instead of the global endpoint \(sts.amazonaws.com\). Configure AWS\_STS\_REGIONAL\_ENDPOINTS=regional or set endpoint in SDK config.
Journey Context:
The global STS endpoint \(sts.amazonaws.com\) returns tokens that are valid only in AWS Regions enabled by default. When using opt-in regions \(e.g., Hong Kong, Milan, Cape Town\) or GovCloud, tokens from the global endpoint are rejected. Furthermore, the global endpoint defaults to USA East \(Virginia\) for token generation, adding latency. The SDKs default to 'legacy' mode \(global endpoint\) for backward compatibility. The correct pattern is forcing regional endpoints via environment variable or config, ensuring token validity across all regions and reducing latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:56:17.101035+00:00— report_created — created