View resource via CLI

View resource via CLI

Table of Contents

View EC2 instances

We can check the profile’s EC2 instances using the following command:

aws ec2 describe-instances --profile devops

AWS CLI

You can specify the region by adding --region <region-name>.

Check S3 buckets

To check the number of S3 buckets in your profile:

aws s3 ls --profile devops

AWS CLI

This command lists all S3 buckets associated with the selected AWS profile.

CLI Auto Prompt

The AWS CLI Auto Prompt helps you interactively create AWS CLI commands:

aws --cli-auto-prompt

AWS CLI

EC2 tabular description

To view EC2 instance details in tabular format for a specific region:

aws ec2 describe-instances --output table --region ap-southeast-1

AWS CLI