diff --git a/.github/workflows/deploy-lambdas.yml b/.github/workflows/deploy-lambdas.yml index 5cc3e7f2e89..6736bb5c59e 100644 --- a/.github/workflows/deploy-lambdas.yml +++ b/.github/workflows/deploy-lambdas.yml @@ -51,7 +51,7 @@ jobs: - name: Upload zips to Prod S3 run: | s3_key="$(basename ${{ matrix.path }})/${{ github.sha }}.zip" - ./lambdas/upload_zip.sh ./out.zip "$s3_key" + ./lambdas/upload_zip.sh ./out.zip "$AWS_REGION" "$s3_key" - name: Configure AWS credentials from GovCloud account uses: aws-actions/configure-aws-credentials@v4 with: @@ -60,7 +60,7 @@ jobs: - name: Upload zips to GovCloud S3 run: | s3_key="$(basename ${{ matrix.path }})/${{ github.sha }}.zip" - ./lambdas/upload_zip.sh ./out.zip "$s3_key" + ./lambdas/upload_zip.sh ./out.zip "$AWS_REGION" "$s3_key" deploy-lambda-ecr: strategy: diff --git a/lambdas/upload_zip.sh b/lambdas/upload_zip.sh index 5c289228194..0f861fcc22a 100755 --- a/lambdas/upload_zip.sh +++ b/lambdas/upload_zip.sh @@ -7,12 +7,12 @@ error() { exit 1 } -[[ $# == 2 ]] || error "Usage: $0 zip_file s3_key" +[[ $# == 3 ]] || error "Usage: $0 zip_file primary_region s3_key" zip_file=$1 -s3_key=$2 +primary_region=$2 +s3_key=$3 -primary_region=$(aws configure get region) || error "Could not get primary region" regions=$(aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text) echo "Uploading to $primary_region..."