Skip to content

Commit

Permalink
add case for future arn generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aaythapa committed Mar 21, 2024
1 parent b9427af commit 3d10ae3
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions samtranslator/translator/arn_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ def _region_to_partition(region: str) -> str:
# setting default partition to aws, this will be overwritten by checking the region below
region_string = region.lower()
if region_string.startswith("cn-"):
return "aws-cn"
if region_string.startswith("us-iso-"):
return "aws-iso"
if region_string.startswith("us-isob"):
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"
partition = "aws-cn"
elif region_string.startswith("us-iso-"):
partition = "aws-iso"
elif region_string.startswith("us-isob"):
partition = "aws-iso-b"
elif region_string.startswith("us-gov"):
partition = "aws-us-gov"
elif region_string.startswith("eu-isoe"):
partition = "aws-iso-e"
elif "iso" in region_string:
partition = "{AWS::Partition}"
else:
partition = "aws"

return partition


class ArnGenerator:
Expand Down

0 comments on commit 3d10ae3

Please sign in to comment.