--query

The AWS CLI option that filters a command’s JSON response with a JMESPath expression before printing it.

In more detail

Combined with --output text or --output table, --query picks just the fields you need, such as InstanceTypes[].InstanceType. Filtering happens in the CLI, after the full response arrives.

Example

--query 'AvailabilityZones[].[ZoneName,ZoneId]' --output text

Related terms

Taught in

References