Skip to content

Commit fb9ed73

Browse files
committed
fix(al2023): fix auth region for pause image cache
1 parent 50147d4 commit fb9ed73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/shared/runtime/bin/cache-pause-container

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ PULL_ARGS=""
2424
if [[ "${PAUSE_CONTAINER_IMAGE}" == *"dkr.ecr"* ]]; then
2525
PULL_ARGS="${PULL_ARGS} --user AWS:$(aws ecr get-login-password)"
2626
elif [[ "${PAUSE_CONTAINER_IMAGE}" == *"public.ecr.aws"* ]]; then
27-
if ECR_PUBLIC_PASSWORD=$(aws ecr-public get-login-password); then
27+
# ECR public authentication must always be through us-east-1
28+
# https://docs.aws.amazon.com/AmazonECR/latest/public/public-registry-auth.html
29+
if ECR_PUBLIC_PASSWORD=$(aws ecr-public get-login-password --region=us-east-1); then
2830
PULL_ARGS="${PULL_ARGS} --user AWS:${ECR_PUBLIC_PASSWORD}"
2931
else
3032
echo "Failed to authenticate to public ECR, retrying with unauthenticated pull" >&2

0 commit comments

Comments
 (0)