AWS is a leading Cloud provider in market and offering many services to the customers. AWS services can be managed through Web console as well as CLI(command line). In this article, we will learn about how we can install and configure AWS CLI on Ubuntu 18.04.

Step 1 – Check Prerequisites For AWS CLI

Python is required for AWS CLI installation. To check the python version execute the below command.

sudo python --version

If you see the python version in the output you can go to next step or if you not get python in your system you can install python first by executing following command

sudo apt-get update

sudo apt-get install python

sudo python --version 

Step 2 – Install python-pip

To install pip for python 2, run following command

sudo apt-get install python-pip

To check if pip is install properly, run following command

pip --version

Step 3 – Install the AWS CLI with pip

Use pip to install the AWS CLI.

When you use the –user switch, pip installs the AWS CLI to ~/.local/bin.

pip install awscli --upgrade --user

Verify that the AWS CLI installed correctly.

aws --version

Step 4- To create access keys for an IAM user

  1. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.
  2. In the navigation pane, choose Users.
  3. Choose the name of the user whose access keys you want to create, and then choose the Security credentials tab.
  4. In the Access keys section, choose Create access key.
  5. To view the new access key pair, choose Show. You will not have access to the secret access key again after this dialog box closes.
  6. To download the key pair, choose Download .csv file. Store the keys in a secure location. You will not have access to the secret access key again after this dialog box closes.

Step 5 – Configuration of the AWS CLI

For general use, the aws configure command is the fastest way to set up your AWS CLI installation. When you type this command, the AWS CLI prompts you for four pieces of information (access key, secret access key, AWS Region, and output format). The AWS Access Key ID and AWS Secret Access Key are your AWS credentials.

aws configure

Step 6 – Use AWS CLI (Try Out Your Things)

It just example aws ec2 describe-vpcs describes one or more of your VPCs.

aws ec2 describe-vpcs

CLI(Command Line Interface) is much more powerful than GUI (Graphical User Interface).