Catalogue
List EC2 Instance Names with the AWS CLI

List EC2 Instance Names with the AWS CLI

🌐 日本語で読む

This is a script that uses the AWS CLI to specify a particular key from the tags set on EC2 instances and list its values.
The example below retrieves the values where Key = Name.

The intent is to get a list of EC2 instance names.

1
aws ec2 describe-instances --query 'Reservations[*].Instances[*].Tags[?Key == `Name`].Value' --output text

That’s all.
I hope you find this helpful.

Author

Kenzo Tanaka

Posted on

2023-11-07

Licensed under