Installing AWS CLI

Installing the Amazon Web Services (AWS) command line interface (CLI) to interact with Amazon’s cloud services.

Installing AWS CLI

  1. Run the commands to install the AWS command line tool:

    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
  2. Enable shell auto-completion for bash by adding the following to your ~/.bashrc:

    complete -C '/usr/local/bin/aws_completer' aws
  3. Create Access keys in AWS Identity and Access Management

    1. Click on your user account

    2. Click on Security credentials

    3. Click on Create access key under Access keys

    4. Select Command Line Interface (CLI)

    5. Check the box for I understand the above recommendation and want to proceed to create an access key

    6. Click Next

    7. Enter AWS CLI as the description tag value and click on Create access key

    8. Leave the tab open for the next step

  4. Run

    aws configure
    1. AWS Access Key ID: <copy/paste from above>

    2. AWS Secret Access Key: <copy/paste from above>

    3. Default region name: us-east-1

    4. Default output format: <Leave blank>

Testing the AWS CLI setup

Running the following command:

aws sts get-caller-identity

Should provide an output like:

Account: ...
Arn: arn:aws:iam::...
UserId: ...