AWS CLI: Let’s Play — Part I

Piyush Jalan
3 min readFeb 23, 2021

AWS Command Line Interface (AWS CLI) is an open source tool that helps you to communicate with AWS resources using commands in your shell command line. With limited setup, the AWS CLI helps to start running commands that enforce features similar to that offered by the browser-based AWS Management Console from the command prompt in your terminal program:

Linux shells — Use common shell programs such as bash, zsh, and tcsh to run commands in Linux or macOS.

Windows command line — On Windows, run commands at the Windows command prompt or in PowerShell.

Remotely — Run commands on Amazon EC2 instances through a remote terminal program such as PuTTY or SSH, or with AWS Systems Manager.

Image 001: ‘aws help’ Command

The AWS CLI is available in two versions:

Version 2.x — The current, generally available release of the AWS CLI that is intended for use in production environments.

Version 1.x — The previous version of the AWS CLI that is available for backwards compatibility.

$ aws — version

Output: aws-cli/2.1.24 Python/3.7.4 Linux/4.14.133–113.105.amzn2.x86_64 botocore/2.0.0

The aws configure command is the fastest way to set up AWS CLI installation. When you enter this command, the AWS CLI prompts you for four pieces of information:

Access key ID

Secret access key

AWS Region

Output format

Image 002: ‘aws configure’ Command

You can store your commonly used configuration settings & credential in files maintained by the AWS CLI. The files are broken down into profiles. By default, the CLI uses the parameters found in the default called profile. Users can override an individual setting by either setting one of the supported environment variables, or by using a command line parameter.

Few examples of AWS CLI commands:

Image 003: ‘aws s3 ls’ Command — to list all available S3 buckets in an account
Image 004: ‘aws ec2 help’ Command
Image 005: ‘aws ecs describe-clusters’ Command
Image 006: ‘aws ecs list-clusters’ Command

The AWS CLI stores sensitive credential information that you specify with aws configure in a local file named credentials, in a folder named .aws in your home directory. To access AWS through proxy servers, you can configure the HTTP_PROXY and HTTPS_PROXY environment variables with either the DNS domain names or IP addresses and port numbers that your proxy servers use.

Please feel free to write @ piyush.jalan93@gmail.com for any queries on AWS CLI and stay tuned for next advanced set of commands.

Thank You !

--

--

Piyush Jalan

Cloud Architect | Cloud Enthusiast | Helping Customers in Adopting Cloud Technology