Skip to content

Commit eb8cc01

Browse files
authored
Merge pull request #171 from aws-samples/fix-update-script
Fix update.sh not using input region for some commands
2 parents 94673f9 + 67d9019 commit eb8cc01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ if [ "$REGION_SET" == "false" ]; then
4242
echo "Warning: Using default region $REGION from your environment. Please ensure this is where pcluster manager is deployed.";
4343
fi
4444

45-
LAMBDA_ARN=$(aws lambda list-functions --query "Functions[?contains(FunctionName, 'PclusterManagerFunction')] | [0].FunctionArn" | xargs echo)
45+
LAMBDA_ARN=$(aws lambda --region ${REGION} list-functions --query "Functions[?contains(FunctionName, 'PclusterManagerFunction')] | [0].FunctionArn" | xargs echo)
4646
ECR_REPO=pcluster-manager-awslambda
4747

4848
PUBLIC_ECR_ENDPOINT="public.ecr.aws/n0x0o5k1"
4949
ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
5050
ECR_ENDPOINT="${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com"
51-
PRIVATE_ECR_REPO=$(aws ecr describe-repositories --query "repositories[?contains(repositoryName, 'pcluster-manager')] | [0].repositoryName" --output text)
51+
PRIVATE_ECR_REPO=$(aws ecr --region ${REGION} describe-repositories --query "repositories[?contains(repositoryName, 'pcluster-manager')] | [0].repositoryName" --output text)
5252
IMAGE=${ECR_ENDPOINT}/${PRIVATE_ECR_REPO}:latest
5353

5454
if [ "$LOCAL" == "true" ]; then
@@ -71,4 +71,4 @@ aws ecr get-login-password --region ${REGION} | docker login --username AWS --pa
7171
echo "Pushing private docker container..."
7272
docker push ${IMAGE}
7373
echo "Updating lambda..."
74-
aws lambda update-function-code --function-name ${LAMBDA_ARN} --image-uri ${IMAGE} --publish
74+
aws lambda --region ${REGION} update-function-code --function-name ${LAMBDA_ARN} --image-uri ${IMAGE} --publish

0 commit comments

Comments
 (0)