How to Install and Configure AWS CLI in Ubuntu

Install and Configure AWS CLI in Ubuntu

In this article we will see how to install and configure the AWS Command Line Interface(CLI) on Ubuntu. Before the installation and configuration we will create the user (i.e gaurav) with “AmazonEC2FullAccess” policy and configure that on AWS-CLI using Access Key and Secret Access Key.

First Login on AWS Console Goto Services And search IAM From Compute Model, refer below screen-shot.

Click on the users option and select add user.

Now add the user name for the new user. This user name will used at the time of sign-in for AWS. You select the “Programmatic access” to select the access for users. Then click on “Next: Permission” button.

On Next Set permissions page, We need to specify how you want to assign permissions to new users. In our case we select the “Attach existing policies to user directly” option, then select the “Next: Review” options.

After reviewing all the choices then Select Create user option.

On the next page, You see the users access keys( i.e access key IDs and secret access keys). You can also download the access keys using “Download .csv” option.

Install AWS Command Line Interface (CLI) in Ubuntu

First You have to install the “python-pip” package which is recommended to the AWS-CLI on Ubuntu Systems.

#sudo apt-get install python-pip

$sudo apt-get install python-pip

Now install the “awscli” using pip command.

$ sudo pip install awscli

Verify the aws-cli is installed correctly.

$ aws --version
aws-cli/1.11.178 Python/2.7.12 Linux/4.4.0-62-generic botocore/1.7.36

Now we have to configure AWS CLI, Execute the “aws configure” command to setting up the AWS-CLI.

$ aws configure
AWS Secret Access Key [None]: 9ELNrL3+REe0OYi3voyUhKvcZqw91ptjoMqhc4tk
Default region name [None]: ap-south-1
Default output format [None]:json

Run below command to check up that your credentials are configured correctly or not.

$ aws ec2 describe-regions --output table
|                     DescribeRegions                    |
||                        Regions                       ||
||             Endpoint              |   RegionName     ||
||     |  ap-south-1      ||
||      |  eu-west-2       ||
||      |  eu-west-1       ||
|| |  ap-northeast-2  ||
|| |  ap-northeast-1  ||
||      |  sa-east-1       ||
||   |  ca-central-1    ||
|| |  ap-southeast-1  ||
|| |  ap-southeast-2  ||
||   |  eu-central-1    ||
||      |  us-east-1       ||
||      |  us-east-2       ||
||      |  us-west-1       ||
||      |  us-west-2       ||

Hope this post will help Linux/Unix beginners. Please share you feedback and Comments. Stay tune for more updates with …!!!

Leave a Reply


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Notify of