-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Hello,
When I am trying to list instance names in text format it works
aws ec2 describe-instances --query 'Reservations[].Instances[].[Tags[?Key==Name].Value[]]' --output text
However when I try to list the same as table it returns an error.
aws ec2 describe-instances --query 'Reservations[].Instances[].[Tags[?Key==Name].Value[]]' --output table
Error - Row should have 1 elements, instead it has 0
My eventual goal is to list all stopped instances with details of instance-id, Name-tag and instance type in a tabular format.
The command I am trying is:
aws ec2 describe-instances --query 'Reservations[].Instances[].[ InstanceId,[Tags[?Key==Name].Value][0][0],State.Name,InstanceType,Placement.AvailabilityZone ]' --output table
Any help would be appreciated.