Pick up the AWS region from the environment. Default to us-west-2.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-11-24 12:46:24 +00:00 committed by Megan Wilhite
parent 7cc6264b41
commit 774bae16b5

View file

@ -58,10 +58,12 @@ with REPO_ROOT.joinpath("cicd", "images.yml").open() as rfh:
REPO_CHECKOUT_ID = hashlib.sha256(
"|".join(list(platform.uname()) + [str(REPO_ROOT)]).encode()
).hexdigest()
AWS_REGION = (
os.environ.get("AWS_DEFAULT_REGION") or os.environ.get("AWS_REGION") or "us-west-2"
)
# Define the command group
vm = command_group(name="vm", help="VM Related Commands", description=__doc__)
vm.add_argument("--region", help="The AWS region.", default="eu-central-1")
vm.add_argument("--region", help="The AWS region.", default=AWS_REGION)
@vm.command(