Circleci 2.0 can't find aws



I’m using circleCI 2.0 and they can’t find aws but their documents clearly say that aws is installed in default

when I use this circle.yml

version: 2
    working_directory: ~/rian
        - image: node:boron
        - checkout
        - run:
            name: Pre-Dependencies
            command: mkdir ~/rian/artifacts
        - restore_cache:
              - rian-{{ .Branch }}-{{ checksum "yarn.lock" }}
              - rian-{{ .Branch }}
              - rian-master
        - run:
            name: Install Dependencies
            command: yarn install
        - run:
            name: Test
            command: |
              node -v
              yarn run test:ci
        - save_cache:
            key: rian-{{ .Branch }}-{{ checksum "yarn.lock" }}
              - "~/.cache/yarn"
        - store_artifacts:
            path: ~/rian/artifacts
            destination: prefix
        - store_test_results:
            path: ~/rian/test-results
        - deploy:
            command: aws s3 sync ~/rian s3://rian-s3-dev/ --delete

following error occurs:

/bin/bash: aws: command not found
Exited with code 127

so if I edit the code this way

    - deploy:
        command: |
          apt-get install awscli
          aws s3 sync ~/rian s3://rian-s3-dev/ --delete

then i get another kind of error:

Reading package lists... Done

Building dependency tree       

Reading state information... Done

E: Unable to locate package awscli
Exited with code 100

Anyone knows how to fix this???


@ceruberu you’re using CircleCI 2.0 but the documentation you linked is for CircleCI 1.0.

You’re using node:boron as your build image. I’m using node:6.10, which is the same image with a different tag. Here’s how I installed awscli:

# install python and awscli
      - run:
          name: Install dependencies
          working_directory: /
          command: |
            apt-get -y -qq update
            apt-get -y -qq install python3.4-dev
            curl -O
            python3.4 --user
            pip install awscli --upgrade --user

awscli install docs:

You could bake these commands, and therefore awscli, into your own public Docker image and start your circle.yml like so:

version: 2
    working_directory: ~/rian
        - image: my-awscli-image:1.0


It’s a Python module not an apt package.


I always want to note that the AWS credentials should now be available within the container by default. No need for special env var workarounds anymore.


thanks I solved it by making my own docker image like you said


Can you elaborate on the should as I might be experiencing the “not being available” side of it.


Can you link to that? I’m 99% sure I worded it that way because the full fleet wasn’t completely updated when I said it.

If you’re using sudo or calling a script, you might need to pass it the env vars.


sudo apt-get -y -qq install awscli worked for me on image: circleci/node:7.10.1, fwiw


The alternative is to apt install python-pip python-dev and pip install awscli


Thanks for above solution…however it is still not working for me. I don’t get build failure or any message about faiure to push content into AWS S3…

**********circle.yml **************

- image: my-image
working_directory: ~/san-d steps:
- run:
name: Install dependencies
working_directory: ~/san-di
command: |
apt-get -y -qq update
apt-get -y -qq install python3.4-dev
curl -O
python3.4 --user
pip install awscli --upgrade --user

- run:
      name: Deploy to S3 if tests pass and branch is Master
        aws s3 sync ~/san-d/app1 s3://meply --delete

version: 2
- build-job
- deploy-job:
- build-job
only: master

Any suggestions , corrections to fix the issue ?

Thanks again !


I hit this issue when deploying to AWS lambda functions and pushing files to S3 bucket. Finally solved it and then built a docker image to save time in installing the AWS CLI every time. Here is a link to the image and the repo!

Fire a PR in or open an issue if you need anything added to the image and I will get to it when I can.


It would be nice to have such common utilities as aws CLI to be bundled in circleci containers by default.


Yeah wasn’t awscli installed by default in circleci 1.0?

Can’t they put it Back in?


It’s odd when you consider that CircleCI has built-in support for AWS keys & secrets, and v2 images also come bundled with other development packages such as git and curl.

Would definitely encourage people to use the circleci/ brand of images, rather than build-your-own-from-ours.