Listing AWS EC2 instances

Viewed 3

How can I list all the EC2 instances in a region using AWS CLI?

1 Answers

In order to list EC2 instance using AWS CLI, you need to perform the following steps:

  1. Install AWS CLI
  2. Set up AWS CLI profile
  3. Run the AWS CLI command

Installing AWS CLI

Refer to this AWS documentation for installation of AWS CLI

Set up AWS CLI profile

Refer to this Confluence page to understand how to set up AWS CLI profile using AWS SSO within NXP.

Run the AWS CLI command

aws ec2 describe-instances --region us-west-2 --profile my-profile-name