Skip to content

Commit

Permalink
chore: add new partition (#3564)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaythapa authored Mar 8, 2024
1 parent 885280d commit bc785e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
7 changes: 1 addition & 6 deletions samtranslator/region_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ def is_apigw_edge_configuration_supported(cls) -> bool:
:return: True, if API Gateway does not support Edge configuration
"""

return ArnGenerator.get_partition_name() not in [
"aws-us-gov",
"aws-iso",
"aws-iso-b",
"aws-cn",
]
return ArnGenerator.get_partition_name() not in ["aws-us-gov", "aws-iso", "aws-iso-b", "aws-cn", "aws-iso-e"]

@classmethod
def is_service_supported(cls, service, region=None): # type: ignore[no-untyped-def]
Expand Down
2 changes: 2 additions & 0 deletions samtranslator/translator/arn_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def _region_to_partition(region: str) -> str:
return "aws-iso-b"
if region_string.startswith("us-gov"):
return "aws-us-gov"
if region_string.startswith("eu-isoe"):
return "aws-iso-e"

return "aws"

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_region_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_when_apigw_edge_configuration_supported(self, partition):
["aws-us-gov"],
["aws-iso"],
["aws-iso-b"],
["aws-iso-e"],
]
)
def test_when_apigw_edge_configuration_is_not_supported(self, partition):
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/translator/test_arn_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class TestArnGenerator(TestCase):
["us-gov-west-1", "aws-us-gov"],
["us-iso-east-1", "aws-iso"],
["us-isob-east-1", "aws-iso-b"],
["eu-isoe-west-1", "aws-iso-e"],
]
)
def test_get_partition_name(self, region, expected_partition):
Expand All @@ -27,6 +28,7 @@ def test_get_partition_name(self, region, expected_partition):
["us-gov-west-1", "aws-us-gov"],
["us-iso-east-1", "aws-iso"],
["us-isob-east-1", "aws-iso-b"],
["eu-isoe-west-1", "aws-iso-e"],
]
)
def test_get_partition_name_when_region_not_provided(self, region, expected_partition):
Expand Down

0 comments on commit bc785e5

Please sign in to comment.