From e4948b212d8e40e0874d3579910e4a548c8b1104 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Fri, 8 Mar 2024 09:19:46 -0800 Subject: [PATCH 1/2] add new partition --- samtranslator/region_configuration.py | 7 +------ samtranslator/translator/arn_generator.py | 2 ++ tests/unit/translator/test_arn_generator.py | 2 ++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/samtranslator/region_configuration.py b/samtranslator/region_configuration.py index 6dfc5121c..c2a210b9c 100644 --- a/samtranslator/region_configuration.py +++ b/samtranslator/region_configuration.py @@ -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] diff --git a/samtranslator/translator/arn_generator.py b/samtranslator/translator/arn_generator.py index 50c180604..a9f6e0325 100644 --- a/samtranslator/translator/arn_generator.py +++ b/samtranslator/translator/arn_generator.py @@ -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" diff --git a/tests/unit/translator/test_arn_generator.py b/tests/unit/translator/test_arn_generator.py index b91bb3143..f31cb7f26 100644 --- a/tests/unit/translator/test_arn_generator.py +++ b/tests/unit/translator/test_arn_generator.py @@ -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): @@ -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): From d0cdc0ba13532a72c20943958ae3c952d7d5cca8 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Fri, 8 Mar 2024 09:21:15 -0800 Subject: [PATCH 2/2] add test --- tests/unit/test_region_configuration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test_region_configuration.py b/tests/unit/test_region_configuration.py index fd00b608d..e9bcf50b3 100644 --- a/tests/unit/test_region_configuration.py +++ b/tests/unit/test_region_configuration.py @@ -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):