I've noticed that standard images still contain AWS CLI v1.
The workaround I'm using to get v2 is uninstalling v1 and installing v2 in the install phase of the buildspec.yml.
Is there a plan to include AWS CLI v2 by default?
I noticed over the weekend that my buildspec.yml commands to download and install v2 starting failing:
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
- unzip -q awscliv2.zip
- ./aws/install -i /usr/local/aws-cli -b /usr/local/bin
Returning: Found preexisting AWS CLI installation: /usr/local/aws-cli/v2/current. Please rerun install script with --update flag.
So I've updated buildspec.yml to:
- ./aws/install -i /usr/local/aws-cli -b /usr/local/bin --update
I haven't found the release notes for this change though.
Had the same issue that @dbaghdanov on my docker codebuild projects, which use codebuild.LinuxBuildImage.STANDARD_4_0, got broken on Friday afternoon:
[Container] 2020/11/22 18:23:22 Running command $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
aws: error: argument operation: Invalid choice, valid choices are:
Had to update my ecr-login command to:
aws ecr get-login-password | docker login --username AWS --password-stdin ${this.dockerRepo.repositoryUri}
to make it work again.
I also haven't found the release notes for this change.
@fdelosrios @dbaghdanov - AWS CLI update to v2 on existing images was not intended (bug). This has been reverted to keep it at v1, as it breaks customer builds. Apologize for the inconvenience caused by the bad deployment.
@anilmujagic - AWS CLI v2 will be added in the new version of CodeBuild image. Existing images will remain at AWS CLI v1.
aws cli v2 is available in standard:5.0.
Most helpful comment
@anilmujagic - AWS CLI v2 will be added in the new version of CodeBuild image. Existing images will remain at AWS CLI v1.