diff --git a/buildspec-release.yml b/buildspec-release.yml index 85cebcb7..a4ff55a5 100644 --- a/buildspec-release.yml +++ b/buildspec-release.yml @@ -11,7 +11,7 @@ phases: pre_build: commands: - start-dockerd - - ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text) + - ACCOUNT=$(aws --region $AWS_DEFAULT_REGION sts --endpoint-url https://sts.$AWS_DEFAULT_REGION.amazonaws.com get-caller-identity --query 'Account' --output text) build: commands: diff --git a/buildspec.yml b/buildspec.yml index c6c4c5d0..214cdcca 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -16,7 +16,7 @@ phases: pre_build: commands: - start-dockerd - - ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text) + - ACCOUNT=$(aws --region $AWS_DEFAULT_REGION sts --endpoint-url https://sts.$AWS_DEFAULT_REGION.amazonaws.com get-caller-identity --query 'Account' --output text) - PREPROD_IMAGE="$ACCOUNT.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$ECR_REPO" - PR_NUM=$(echo $CODEBUILD_SOURCE_VERSION | grep -o '[0-9]\+') - echo 'Pull request number:' $PR_NUM '. No value means this build is not from pull request.'