From 1f51a442e163cca5f4b38f216c2a3f55d8e0a58c Mon Sep 17 00:00:00 2001 From: awsluja Date: Wed, 9 Aug 2023 16:31:20 -0400 Subject: [PATCH] ci: make region parameter to batch script --- scripts/cloud-cli-utils.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/cloud-cli-utils.sh b/scripts/cloud-cli-utils.sh index 949354b8d5..e51693f8fd 100644 --- a/scripts/cloud-cli-utils.sh +++ b/scripts/cloud-cli-utils.sh @@ -6,6 +6,8 @@ set -e set -o allexport source ./scripts/.env set +REGION=us-east-1 + function authenticate { account_number=$1 role_name=$2 @@ -14,7 +16,7 @@ function authenticate { mwinit --aea echo Loading account credentials for Account $account_number with Role: $role_name... ada cred update --profile="${profile_name}" --account="${account_number}" --role=${role_name} --provider=isengard --once - aws configure set region us-east-1 --profile $profile_name + aws configure set region $REGION --profile $profile_name } function triggerProjectBatch { account_number=$1 @@ -26,8 +28,8 @@ function triggerProjectBatch { echo AWS Account: $account_number echo Project: $project_name echo Target Branch: $target_branch - RESULT=$(aws codebuild start-build-batch --profile="${profile_name}" --project-name $project_name --source-version=$target_branch \ + RESULT=$(aws codebuild start-build-batch --region=$REGION --profile="${profile_name}" --project-name $project_name --source-version=$target_branch \ --environment-variables-override name=BRANCH_NAME,value=$target_branch,type=PLAINTEXT \ --query 'buildBatch.id' --output text) - echo "https://us-east-1.console.aws.amazon.com/codesuite/codebuild/$account_number/projects/$project_name/batch/$RESULT?region=us-east-1" + echo "https://$REGION.console.aws.amazon.com/codesuite/codebuild/$account_number/projects/$project_name/batch/$RESULT?region=$REGION" }