Using AWS CodeArtifact with circleci/aws-cli

Does the orb circleci/aws-cli@5.2 support CodeArtifact?

I am getting an error codeartifact: command not found when running

aws codeartifact get-authorization-token \
                          --domain our-pypi-domain \
                          --query authorizationToken \
                          --output text

but

aws ecr get-login-password --region us-west-2

works correctly

Hi @user_07022024 , looking at the error, it’s upset that the (sub)command codeartifact is not found, so its not the missing AWS CLI itself, hence why aws ecr command does work.

My hunch with limited details is that it’s likely an older AWS CLI version.

Is your call to the orb passing a value for version parameter? By default it will install the latest, unless provided a specific value. It would be useful to run aws --version to confirm what version is being installed and compare to minimum needed for CodeArtifact.

If you have an older version of the AWS CLI installed, you must upgrade it so the CodeArtifact commands are available. CodeArtifact commands are available in the following AWS CLI versions:

  1. AWS CLI 1: 1.18.77 and newer
  2. AWS CLI 2: 2.0.21 and newer