The installation and configuration process for AWS CLI is fairly simple. The package itself is installed with pip (yum -y install python-pip):

Selecting what you need from the output can be accomplished via awscli filters and queries; using the excellent jq JSON processor; or just using awk, sed, and whatever other standard shell tools you like. My preference is to keep awscli queries simple and do most of the formatting in the shell.

The first time you run awscli you will be prompted to provide your API credentials. You would need to supply the AWS Access Key ID, the AWS Secret Access Key, and the default region the can be modified from command line along with other variables.

You can obtain this info by logging into your AWS account, clicking on your username in the upper right-hand corner ➡ My Security Credentials ➡ Users ➡ Select your username ➡ Security Credentials ➡ Create access key.

In the examples below I used a variety of methods for massaging the output. Not because this was the most efficient way of doing things, but just to illustrate the available options.

List running instances

List all instances in a table format

See if any running instances have scheduled events

List stopped instances and reason why

List AWS Dashboard users

List EBS volumes for a specific instance

List EBS volumes for all instances

List snapshots of volumes for a specific instance

NOTE: It would appear that particularly old snapshots are not reported via the CLI, while still visible in the Web UI. I am not sure if this is by design, or if this is just some issue on my end. I briefly consulted the documentation, but did not find any mention of this behavior.

Describe snapshots of volumes for a specific instance

Generate snapshot report for all running instances

Make a screenshot of the instance’s terminal and email it


Leave A Reply

Please enter your comment!
Please enter your name here