From b1ab2c7e530af7ea89fd03fd2094bab5160b9118 Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Tue, 5 Sep 2023 12:09:46 +0200 Subject: [PATCH 1/2] Make AWS region name configurable for tests --- localstack/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localstack/constants.py b/localstack/constants.py index 1127e9098439c..5a1d0707bdc4d 100644 --- a/localstack/constants.py +++ b/localstack/constants.py @@ -156,13 +156,13 @@ TEST_AWS_ACCOUNT_ID = os.getenv("TEST_AWS_ACCOUNT_ID") or DEFAULT_AWS_ACCOUNT_ID TEST_AWS_ACCESS_KEY_ID = os.getenv("TEST_AWS_ACCESS_KEY_ID") or "test" TEST_AWS_SECRET_ACCESS_KEY = os.getenv("TEST_AWS_SECRET_ACCESS_KEY") or "test" -TEST_AWS_REGION_NAME = "us-east-1" +TEST_AWS_REGION_NAME = os.getenv("TEST_AWS_REGION_NAME") or "us-east-1" # Additional credentials used in the test suite (when running cross-account tests) SECONDARY_TEST_AWS_ACCOUNT_ID = os.getenv("SECONDARY_TEST_AWS_ACCOUNT_ID") or "000000000002" SECONDARY_TEST_AWS_ACCESS_KEY_ID = os.getenv("SECONDARY_TEST_AWS_ACCESS_KEY_ID") or "000000000002" SECONDARY_TEST_AWS_SECRET_ACCESS_KEY = os.getenv("SECONDARY_TEST_AWS_SECRET_ACCESS_KEY") or "test2" -SECONDARY_TEST_AWS_REGION_NAME = "ap-southeast-1" +SECONDARY_TEST_AWS_REGION_NAME = os.getenv("SECONDARY_TEST_AWS_REGION_NAME") or "ap-southeast-1" # Credentials used for internal calls INTERNAL_AWS_ACCESS_KEY_ID = "__internal_call__" From 952a54734658ebce179f6f70eac66095ba99ae7e Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Wed, 6 Sep 2023 14:47:24 +0200 Subject: [PATCH 2/2] Align environment variable naming with AWS CLI Removing the suffix `_NAME` aligns the environment variable naming with the AWS CLI using `AWS_REGION` (which overwrites `AWS_DEFAULT_REGION`). https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html --- localstack/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localstack/constants.py b/localstack/constants.py index 5a1d0707bdc4d..8abca4bf08009 100644 --- a/localstack/constants.py +++ b/localstack/constants.py @@ -156,13 +156,13 @@ TEST_AWS_ACCOUNT_ID = os.getenv("TEST_AWS_ACCOUNT_ID") or DEFAULT_AWS_ACCOUNT_ID TEST_AWS_ACCESS_KEY_ID = os.getenv("TEST_AWS_ACCESS_KEY_ID") or "test" TEST_AWS_SECRET_ACCESS_KEY = os.getenv("TEST_AWS_SECRET_ACCESS_KEY") or "test" -TEST_AWS_REGION_NAME = os.getenv("TEST_AWS_REGION_NAME") or "us-east-1" +TEST_AWS_REGION_NAME = os.getenv("TEST_AWS_REGION") or "us-east-1" # Additional credentials used in the test suite (when running cross-account tests) SECONDARY_TEST_AWS_ACCOUNT_ID = os.getenv("SECONDARY_TEST_AWS_ACCOUNT_ID") or "000000000002" SECONDARY_TEST_AWS_ACCESS_KEY_ID = os.getenv("SECONDARY_TEST_AWS_ACCESS_KEY_ID") or "000000000002" SECONDARY_TEST_AWS_SECRET_ACCESS_KEY = os.getenv("SECONDARY_TEST_AWS_SECRET_ACCESS_KEY") or "test2" -SECONDARY_TEST_AWS_REGION_NAME = os.getenv("SECONDARY_TEST_AWS_REGION_NAME") or "ap-southeast-1" +SECONDARY_TEST_AWS_REGION_NAME = os.getenv("SECONDARY_TEST_AWS_REGION") or "ap-southeast-1" # Credentials used for internal calls INTERNAL_AWS_ACCESS_KEY_ID = "__internal_call__"