Skip to content

Commit f8c3688

Browse files
authored
chore: add new partition (#3763)
1 parent 857db28 commit f8c3688

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

samtranslator/region_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def is_apigw_edge_configuration_supported(cls) -> bool:
1818
:return: True, if API Gateway does not support Edge configuration
1919
"""
2020
partition = ArnGenerator.get_partition_name()
21-
if partition.startswith("aws-iso") or partition in ["aws-us-gov", "aws-cn"]:
21+
if partition.startswith("aws-iso") or partition in ["aws-us-gov", "aws-cn", "aws-eusc"]:
2222
return False
2323
return True
2424

samtranslator/translator/arn_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _region_to_partition(region: str) -> str:
2424
"us-gov": "aws-us-gov",
2525
"eu-isoe": "aws-iso-e",
2626
"us-isof": "aws-iso-f",
27+
"eusc-": "aws-eusc",
2728
}
2829
for key, value in region_to_partition_map.items():
2930
if region_string.startswith(key):

tests/translator/test_arn_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def setUp(self):
1818
("eu-isoe-west-1", "aws-iso-e"),
1919
("US-EAST-1", "aws"),
2020
("us-isof-east-1", "aws-iso-f"),
21+
("eusc-de-east-1", "aws-eusc"),
2122
]
2223
)
2324
def test_get_partition_name(self, region, expected):

tests/unit/test_region_configuration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def test_when_apigw_edge_configuration_supported(self, partition):
2020

2121
self.assertTrue(RegionConfiguration.is_apigw_edge_configuration_supported())
2222

23-
@parameterized.expand([["aws-cn"], ["aws-us-gov"], ["aws-iso"], ["aws-iso-b"], ["aws-iso-e"], ["aws-iso-f"]])
23+
@parameterized.expand(
24+
[["aws-cn"], ["aws-us-gov"], ["aws-iso"], ["aws-iso-b"], ["aws-iso-e"], ["aws-iso-f"], ["aws-eusc"]]
25+
)
2426
def test_when_apigw_edge_configuration_is_not_supported(self, partition):
2527
with patch(
2628
"samtranslator.translator.arn_generator.ArnGenerator.get_partition_name"

tests/unit/translator/test_arn_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class TestArnGenerator(TestCase):
1515
["us-iso-east-1", "aws-iso"],
1616
["us-isob-east-1", "aws-iso-b"],
1717
["eu-isoe-west-1", "aws-iso-e"],
18+
["eusc-de-east-1", "aws-eusc"],
1819
]
1920
)
2021
def test_get_partition_name(self, region, expected_partition):

0 commit comments

Comments
 (0)