Skip to content

Commit b6c0103

Browse files
committed
[Test] Define constants for the AWS domains.
Signed-off-by: Giacomo Marciani <mgiacomo@amazon.com>
1 parent 46163eb commit b6c0103

File tree

1 file changed

+10
-4
lines changed
  • tests/integration-tests/tests/common

1 file changed

+10
-4
lines changed

tests/integration-tests/tests/common/utils.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,22 @@ def get_installed_parallelcluster_base_version():
227227
return pkg_resources.packaging.version.parse(get_installed_parallelcluster_version()).base_version
228228

229229

230+
CLASSIC_AWS_DOMAIN = "amazonaws.com"
231+
CHINA_AWS_DOMAIN = "amazonaws.com.cn"
232+
US_ISO_AWS_DOMAIN = "c2s.ic.gov"
233+
US_ISOB_AWS_DOMAIN = "sc2s.sgov.gov"
234+
235+
230236
def get_aws_domain(region: str):
231237
"""Get AWS domain for the given region."""
232238
if region.startswith("cn-"):
233-
return "amazonaws.com.cn"
239+
return CHINA_AWS_DOMAIN
234240
elif region.startswith("us-iso-"):
235-
return "c2s.ic.gov"
241+
return US_ISO_AWS_DOMAIN
236242
elif region.startswith("us-isob-"):
237-
return "sc2s.sgov.gov"
243+
return US_ISOB_AWS_DOMAIN
238244
else:
239-
return "amazonaws.com"
245+
return CLASSIC_AWS_DOMAIN
240246

241247

242248
def get_sts_endpoint(region):

0 commit comments

Comments
 (0)