Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Installing Amazon CLI

To access the S3 buckets you previously created, from your EC2 instance you need to install
Amazon CLI tools on your EC2 instance. The steps for the same are given below.
1. Connect to your EC2 instance using Putty.

2. Switch to the root user using the following command.

3. Check if you have Amazon CLI installed using the command


aws --version

If you get the message “command not found” you need to install CLI using the
commands below, else you can skip the installation part.

4. Next, check if Python is available


python --version

You should have Python 2.7.5 installed


5. Next, you need to download the Amazon CLi package and unzip it using the below
commands
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
yum -y install unzip

unzip awscli-bundle.zip

6. Now install the unzipped file using the below command

./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

7. Next you need to edit the .bashrc file where you need to add the line
alias aws='/usr/local/bin/aws' ​at the end of the file. To do this, open the
.bashrc file using the command

vi .bashrc

In the editor, add/paste the above line as shown below.

You can exit the editor by pressing the escape key followed by ​:wq!

8. Then update the .bashrc file using the command ​source .bashrc

9. Now verify if the aws CLI is installed or not using the command ​aws --version

10. Next, you need to configure your Access Key, Secret Key which you created in the
previous docs, and region using the command ​aws configure.

Note: ​Enter the access keys and secret keys from the csv file you downloaded in
previous docs. The region name will be us-east-1.
11. You can now see your buckets using the commands ​aws s3 ls

You might also like