AWS CLI installation and setup

This article  we are going to help you use the AWS Command Line Interface (CLI) installation & configuration to access Amazon S3

  • Set up  and Configure  Pip & Python
  • Install awscli using pip
  • Set up and configure  aws cli tool 
  • Check and Verify
  • AWS console configuration

Install python-pip:

apt-get update

Then let’s install python-pip and any required packages:

apt-get -y install python-pip

OR

We can  use curl and python to download and install Pip.

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
pip -V

Install AWS CLI using pip :

pip install awscli

AWS Console Configuration :

Before start to use AWS CLI we need to create user with right permissions. So I created a new user “swtestacademy”

Click on Users on the left side.

Getting-Started-IAM1

Click the Create New Users button.

2016-06-16_14-30-52

Click the Download Credentials button and save the credentials.csv file

AWS_accesskey

Click on the Permissions tab and then click on the Attach Policy button.

2016-06-16_14-35-24

Open terminal :

aws configure

The AWS CLI will prompt you for four pieces of information. AWS Access Key ID and AWS Secret Access Key are your account credentials


aws_conigure

 

AWS CLI stores credentials specified with aws configure in a local file named credentials in a folder named .aws in your home directory and installation can be verified using below command.

ls ~/.aws
aws help

Now I can create s3 bucket – to create a new bucket named my-first-backup1

aws s3 mb s3://my-first-backup1

aws_s3_mb_s3

AWS-CLI can list s3 buckets which I created before

aws s3 ls

aws_s3_ls

AWS regions & endpoints information

aws ec2 describe-regions

[fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”]

aws_ec2_describe_regions
ec2

Terminate your instance:

 aws ec2 terminate-instances --instance-ids i-636de6ff

terminate_instance

for more information about aws-cli visit

Hope you find helpful.
Onur Yazir

Leave a Comment

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