Skip to content

Commit

Permalink
Use consistent method of determining AWS Partition from a region (#2899)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Cristina <[email protected]>
  • Loading branch information
acristin and Andrew Cristina authored Feb 13, 2023
1 parent 83306d3 commit 59dd0d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion integration/helpers/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def setUpClass(cls):
cls.code_dir = Path(cls.resources_dir, "code")
cls.session = boto3.session.Session()
cls.my_region = cls.session.region_name
cls.partition = cls.session.get_partition_for_region(cls.my_region)
cls.client_provider = ClientProvider()
cls.file_to_s3_uri_map = read_test_config_file("file_to_s3_map_modified.json")
cls.code_key_to_file = read_test_config_file("code_key_to_file_map.json")
Expand Down
2 changes: 1 addition & 1 deletion samtranslator/region_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def is_service_supported(cls, service, region=None): # type: ignore[no-untyped-
raise NoRegionFound("AWS Region cannot be found")

# check if the service is available in region
partition = session.get_partition_for_region(region)
partition = ArnGenerator.get_partition_name(region)
available_regions = session.get_available_regions(service, partition_name=partition)
return region in available_regions

0 comments on commit 59dd0d8

Please sign in to comment.