AWS- Command Line Interface

AWS – Command Line Interface(CLI)

The AWS Command Line Interface (AWS CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell.

  • Windows : Download and run the 64-bit or 32-bit Windows installer.

  • Mac and Linux :Requires Python 2.6.5 or higher. Or Install using pip.

Once you have installed the AWS CLI, you now need to configure the application to be able to connect to your AWS account. To do so, enter the following from your command prompt:

aws configure

AWS CLI will prompt you for AWS access key ID and AWS secret access key(account credentials). You can generate new credentials within AWS Identity and Access Management (IAM) if you do not already have them. The other information you will need is region and output format, which you can leave as default.

IAM > Users > Select User > Security Credencials > Create Access Key

aws configure 
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE 
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 
Default region name [None]: us-west-2 
Default output format [None]: json

Here are some Sample ALI commands:

List all your users and display the output in a table:
aws iam list-users --output table

List all your EC2 tags:
aws ec2 describe-tags --output table

Play around with outputs, help, or whatever:
aws ec2 describe-spot-price-history help
aws ec2 describe-instances