--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 textRelated terms
- AWS CLI — Amazon's command-line tool for calling AWS services from a terminal or script.
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
- jq — A command-line tool that reads, filters and reshapes JSON data.
Taught in
- Capital to Operating Expenditure — Cloud Infrastructure & Hyperscaler Architecture
- Elasticity and Scale — Cloud Infrastructure & Hyperscaler Architecture
- The Shared Responsibility Model — Cloud Infrastructure & Hyperscaler Architecture
- Regions, Availability Zones and Reliability — Cloud Infrastructure & Hyperscaler Architecture
- IAM as the Foundation — Cloud Infrastructure & Hyperscaler Architecture
- Users, Groups and Roles — Cloud Infrastructure & Hyperscaler Architecture
- Policies and Least Privilege — Cloud Infrastructure & Hyperscaler Architecture
- The Danger of Long-Lived Keys — Cloud Infrastructure & Hyperscaler Architecture
- Policy Simulation and Dry Runs — Cloud Infrastructure & Hyperscaler Architecture
- Route Tables and Internet Gateways — Cloud Infrastructure & Hyperscaler Architecture
- Security Groups and Firewalls — Cloud Infrastructure & Hyperscaler Architecture
- Load Balancing and DNS — Cloud Infrastructure & Hyperscaler Architecture
- Elastic Compute Cloud (EC2) — Cloud Infrastructure & Hyperscaler Architecture
- The Console versus the CLI — Cloud Infrastructure & Hyperscaler Architecture