Amazon Web Services/AWS Command Line Tool (CLI)

The AWS Command Line Interface, abbreviated as AWS CLI, is a unified tool to manage your AWS services. With AWS CLI, you can control multiple AWS services from the command line and automate them through scripts.

Installation and configuration
Install on Linux:

Check the installed awscli version (also to confirm the installation):

To configure your AWS CLI access:  or.

You will be prompted to enter a username and password. Configuration will be saved in directory  in files   and.

Execute  to view your actual configuration. If you execute for the first time will be something like: Name                   Value             Type    Location -                   profile                            None    None access_key                           None    None secret_key                           None    None region                           None    None
 * 1) aws configure list

AWS EC2 commands
Before starting to use AWS CLI, you will need to configure IAM policies for your user.


 * Get a list of EC2 instances:


 * Get a list of EC2 instances and filter Name, Id and Status:


 * Create or run an instance


 * Start an EC2 instance:
 * (Use your own instance-id)


 * Stop an EC2 instance:
 * (Use your own instance-id)


 * Show Relational Database Service (RDS) instances:


 * Query and display EC2 metadata:  (Distributed in   package at least in Debian)

AWS S3 commands

 * List your buckets:

for region_name in ap-south-1 eu-west-3 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; do   aws s3api list-buckets --region $region_name done
 * List your buckets in all regions:


 * If you do not have permisssions you will get the following error:
 * An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied
 * An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied


 * (You can also use a profile to define your credentials)
 * Size of a Bucket:
 * Size of a Bucket:
 * Size of a Bucket:

AWS IAM commands

 * If you do not have permisssions you will get the following error:
 * An error occurred (AccessDenied) when calling the ListUsers operation: User: arn:aws:iam::146910341356:user/MY_USERNAME is not authorized to perform: iam:ListUsers on resource: arn:aws:iam::146910341356:user/
 * An error occurred (AccessDenied) when calling the ListUsers operation: User: arn:aws:iam::146910341356:user/MY_USERNAME is not authorized to perform: iam:ListUsers on resource: arn:aws:iam::146910341356:user/



AWS Security commands

 * Authorizing Inbond Traffic from anywhere to TCO port 80