Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default sts client config to regional endpoints #3309

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion botocore/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def _get_sts_regional_endpoints_config(self):
'sts_regional_endpoints'
)
if not sts_regional_endpoints_config:
sts_regional_endpoints_config = 'legacy'
sts_regional_endpoints_config = 'regional'
if (
sts_regional_endpoints_config
not in VALID_REGIONAL_ENDPOINTS_CONFIG
Expand Down
17 changes: 10 additions & 7 deletions tests/unit/test_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,18 +393,21 @@ def test_sts_http_scheme_for_override_endpoint(self):
client_args['endpoint'].host, 'http://sts.amazonaws.com'
)

def test_sts_regional_endpoints_defaults_to_legacy_if_not_set(self):
def test_sts_regional_endpoints_defaults_to_regional_if_not_set(self):
resolved_endpoint = 'https://resolved-endpoint'
resolved_region = 'resolved-region'
self._set_endpoint_bridge_resolve(
endpoint_url=resolved_endpoint, signing_region=resolved_region
)
self.config_store.set_config_variable('sts_regional_endpoints', None)
client_args = self.call_get_client_args(
service_model=self._get_service_model('sts'),
region_name='us-west-2',
endpoint_url=None,
)
self.assertEqual(client_args['endpoint'].host, resolved_endpoint)
self.assertEqual(
client_args['endpoint'].host, 'https://sts.amazonaws.com'
)
self.assertEqual(
client_args['request_signer'].region_name, 'us-east-1'
client_args['request_signer'].region_name, resolved_region
)

def test_invalid_sts_regional_endpoints(self):
Expand Down Expand Up @@ -669,7 +672,7 @@ def test_builtins_defaults(self):
self.assertEqual(bins['AWS::Region'], 'ca-central-1')
self.assertEqual(bins['AWS::UseFIPS'], False)
self.assertEqual(bins['AWS::UseDualStack'], False)
self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], True)
self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], False)
self.assertEqual(bins['AWS::S3::UseGlobalEndpoint'], False)
self.assertEqual(bins['AWS::S3::Accelerate'], False)
self.assertEqual(bins['AWS::S3::ForcePathStyle'], False)
Expand Down Expand Up @@ -723,7 +726,7 @@ def test_aws_sts_global_endpoint_with_default_and_legacy_region(self):
bins = self.call_compute_endpoint_resolver_builtin_defaults(
region_name='us-west-2',
)
self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], True)
self.assertEqual(bins['AWS::STS::UseGlobalEndpoint'], False)

def test_aws_sts_global_endpoint_with_default_and_nonlegacy_region(self):
bins = self.call_compute_endpoint_resolver_builtin_defaults(
Expand Down
Loading