AWS CLI Cheatsheet
Top commands.
Overview
The AWS CLI is the universal scripting and operational interface for AWS. The cheatsheet captures the patterns operators actually use; fluency under pressure beats console-clicking when the incident is ten minutes in.
- Top commands.
ec2,s3,iam,sts,logs,ssm; the six namespaces that cover most operations. - Profiles. Per-account credentials;
--profile prodbeats hand-edited environment variables every time. - --query JMESPath. Server-side filtering; reduces output to what you actually need; faster than client-side
jq. - --output plus pagination.
json/yaml/textfor downstream tooling;--no-paginatefor known-small results.
The approach
The practical approach: profile per account, --query filter everything, scriptable output. The team’s discipline turns ad-hoc clicks into reproducible operations.
- aws configure sso. Modern SSO-based auth; replaces long-lived API keys; matches enterprise IdP setup.
- aws --profile prod. Explicit account selection per command; the muscle memory that prevents production accidents.
- --query 'Reservations[].Instances[].InstanceId'. Server-side filtering; the alternative is parsing 10MB of JSON locally.
- --output text for scripts. Tab-separated for
awk/cut; the canonical shape for shell pipelines. - aws sts get-caller-identity. Verify which account you’re acting in; the safeguard against the profile mistake.
Why this compounds
AWS CLI fluency compounds across operations. Each captured pattern grows the team’s automation surface; cost-per-question falls as the muscle matures.
- Faster operations. Fluent CLI produces fast results; common queries take seconds, not minutes of console navigation.
- Better automation. CLI in scripts produces reproducible operations; the team’s automation library compounds.
- Better investigation. CLI for ad-hoc queries replaces console clicks; the data lands in the terminal where you can pipe it.
- Institutional knowledge. Each command teaches AWS APIs; the team’s automation muscle grows.
AWS CLI fluency is an operational discipline that pays off across years. Nova AI Ops integrates with AWS telemetry, surfaces patterns, and supports the team’s automation discipline.