AMAZON WEB SERVICES COMMAND LINE INTERFACE (AWS CLI)
In this tutorial, We are going to learn how to install and configure AWS CLI to manage all the AWS services in the command line on Ubuntu Linux.
Make sure you have Linux machine installed with python either of below-mentioned version.
- Python 2 version 2.6.5+ or Python 3 version 3.3+
Installation of AWSCLI
Download the AWSCLI Bundle
#curl “https://s3.amazonaws.com/aws-cli/awscli-bundle.zip” -o “awscli-bundle.zip”
Unzip the bundle
Go to the awscli-bundle directory
Run the following command
#./install -i /usr/local/aws -b /usr/local/bin/aws
You will see the following output.
The Parameter “i” represents the installation directory of AWS CLI and the parameter “b” represents the binary location of AWS CLI.
You can check the version of AWS CLI using the below command:
[[email protected] ec2-user]# /usr/local/bin/aws –version
aws-cli/1.14.16 Python/2.7.5 Linux/3.10.0-693.el7.x86_64 botocore/1.8.20
Before configuring AWS CLI, Make sure you have the details of ACCESS KEY AND SECRET KEY in hand.
If you don’t have the following details.You can get these details from AWS Security Credentials Page
If prompted Login to your AWS account.You will see the following Page.
Expand Access Keys (access key ID and secret access key).
Click Create New Access key, You can note the keys from Show access key option or you can download the key file.
Once, You have both keys, We can move forward to configure AWS CLI.
To Configure AWS CLI, Run the below Command:
It will ask for the ACCESS KEY AND SECRET KEY VALUES Once entered, It will ask for Default Region Name, Provide the location you want to access and For Default output format, Just Enter.
That’s all. Now You have configured AWS CLI on your Linux machine.Now You can control all your AWS resources.
The below command will give you the detailed lists of services available:
To work on specific services, You can use the below commands:
#aws ec2(any service) help
To view the complete detail about your instances in AWS:
#aws ec2 describe-instances –output table
Thanks for reading this tutorial.