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

chore: add new partition #3564

Merged
merged 2 commits into from
Mar 8, 2024
Merged
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
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