Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cards › AWS

AWS Cloud

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.

Shape output with --query Raw JSON is long. You need just one value for a script. --query uses JMESPath to pick fields on your machine. Add --output text for scripts, table for humans. Example: list running IDs only.
Shape output with --query · Download PNG
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']"

See all AWS revision cards