AWS EC2 Cheatsheet
Top commands.
Overview
The EC2 CLI cheatsheet captures the patterns operators actually use during instance investigation. Fluency at EC2 commands shortens incident response and informs capacity decisions before they hit production.
- Top commands.
describe-instances,run-instances,terminate-instances,get-console-output; the four that cover most paths. - Filters. Per-tag, per-state, per-VPC filtering;
describe-instanceswith no filter is rarely the right call. - Instance metadata. IMDSv2 token-based access; the modern, SSRF-resistant default; required by security policy at most orgs.
- Spot plus auto-recovery. Spot for cheap interruptible compute; status checks plus CloudWatch alarms for self-healing.
The approach
The practical approach: filter to narrow scope, tag everything, IMDSv2 required everywhere. The team’s discipline produces fast operations and avoids the common security and cost pitfalls.
- describe-instances --filters Name=tag:env,Values=prod. Per-tag filter; narrow before you read; the alternative is parsing 10k JSON entries.
- get-console-output --instance-id i-xxxx. Boot console output; first call when an instance fails to come up cleanly.
- modify-instance-metadata-options --http-tokens required. Force IMDSv2; the SSRF-prevention default; ship enabled, not optional.
- describe-instance-status. Health check status (system + instance); catches infrastructure-level failures before user impact.
- Document patterns. Per-environment conventions committed to the repo; supports investigation and onboarding.
Why this compounds
EC2 fluency compounds across operations. Each captured pattern grows the team’s automation surface; cost-per-question falls as the playbook matures.
- Faster operations. Fluent EC2 produces fast results; common queries take seconds, not minutes.
- Better security. IMDSv2 required catches credential exposure; the security baseline is enforced not aspirational.
- Better cost efficiency. Spot, scheduled instances, right-sizing all reduce cost; the savings compound across years of growth.
- Institutional knowledge. Each command teaches EC2 patterns; the team’s compute engineering muscle grows.
EC2 fluency is an operational discipline that pays off across years. Nova AI Ops integrates with EC2 telemetry, surfaces patterns, and supports the team’s compute discipline.