AWS CLI Command Line: How to use “–query” to output multiple source lines

[*]

aws ec2 describe-instances --instance-id i-77777777 \
  --query 'Reservations[*].Instances[*].[InstanceId,ImageId,Tags[*]]' \
  --output text

This command will print Instance Id, AMI ID, Key and Value Tags.
You can see more examples here:
Controlling Command Output from the AWS Command Line Interface

[*]

Leave a Comment