Ravi Sir's Cards › AWS
Shape output with --query
This revision card explains Shape output with --query. It starts from the need that raw JSON is long. You need just one value for a script. It describes reservations[].Instances[].InstanceId. The how-to section covers how to add --output text for scripts, table for humans. An example on the card is example: list running IDs only.
Read card text
What this card says
Why do we need it?
Raw JSON is long. You need just one value for a script.
What is it?
--query uses JMESPath to pick fields on your machine.
Reservations[].Instances[].InstanceId
How to do it
Add --output text for scripts, table for humans.
Example
Example: list running IDs only.
--query "...[?State.Name=='running']"