aws-sdk-js
aws-sdk-js copied to clipboard
AWS STS Regionalized endpoints not applied by SDK for JavaScript 2.x
Describe the bug
According to the AWS STS Regionalized endpoints documentation, setting the AWS_STS_REGIONAL_ENDPOINTS environment variable to regional should cause the SDK to always use the regional endpoint (ie - "https://sts.<region>.amazonaws.com"
) instead of the global service endpoint (ie - "https://sts.amazonaws.com"
). However, setting this environment variable has no effect, and requests continue to be sent to the global service endpoint.
Is the issue in the browser/Node.js? Node.js
Details of the browser/Node.js version 16.11.1
Expected Behavior
When AWS_STS_REGIONAL_ENDPOINTS is set to 'regional', I expected requests to be sent to the regional endpoint.
Current Behavior
When AWS_STS_REGIONAL_ENDPOINTS is set to 'regional', the SDK still sends requests to the global endpoint.
Reproduction Steps
process.env.AWS_STS_REGIONAL_ENDPOINTS = 'regional';
const STS = require('aws-sdk/clients/sts');
const stsClient = new STS({
region: 'us-west-2'
});
stsClient.assumeRole({}) // Request sent to global endpoint
Possible Solution
No response
Additional Information/Context
No response
SDK version used
2.1145.0
Environment details (OS name and version, etc.)
Windows 10
Hey @Fotiman thanks for opening this issue, I was able to reproduce this, interestingly its still sent to wrong endpoint if I add it to the config file.
there is an opt-in config for STS called stsRegionalEndpoints
which should be set to "regional"
(string).
Does using the constructor to set this value work?