0
votes

I'm having an issue while logging into ECR.

buildspec.yml

...
- echo $AWS_DEFAULT_REGION and $AWS_ACCOUNT_ID
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com

Following command return me "us-east-2" and "" ($AWS_ACCOUNT_ID is empty)

- echo $AWS_DEFAULT_REGION and $AWS_ACCOUNT_ID

so that's why I'm unable to login to ECR.

1

1 Answers

1
votes

Because there is no default codebuild environment variable named AWS_ACCOUNT_ID

Here Environment variables in build environments you can find all default codebuild environment variables.