All cheat sheets
Computecheat sheet

Spot Instances

Spare EC2 capacity at up to 90% off — with a 2-minute reclaim warning. The best cost lever in AWS for fault-tolerant, checkpointable, stateless workloads (batch, rendering, CI/CD, ML training). Diversify across types/AZs and set max price to On-Demand.

Last reviewed: July 14, 2026

TL;DR: Spot Instances are spare EC2 capacity AWS rents at up to 90% off — as long as they don't need it back, which they signal with a 2-minute warning. Since 2017 there's no bidding: you pay the current Spot price (set by long-term supply/demand) up to a max you choose. It's the single biggest cost lever in AWS for fault-tolerant, stateless, checkpointable workloads (batch, rendering, CI/CD, ML training) — and terrible for databases and strict-uptime customer-facing apps. Design for the constraints and it transforms the bill.

The numbers

  • Typically 50–90% off On-Demand — e.g. m5.xlarge ~$0.192/hr On-Demand vs ~$0.038/hr Spot (~80%).
  • 2-minute warning via instance metadata + a CloudWatch event; interruption frequency varies by type/region (AWS publishes it — some instances run for weeks uninterrupted).
  • Max price protects you: exceed it and the instance terminates, so most teams set max = On-Demand price (you almost always pay far less and never overpay).
  • Field examples: a nightly ETL checkpointing to S3 every few minutes cut compute 75%; a stateless REST API ran 70% of capacity on Spot behind an ALB (m5/m5a/m5n across 3 AZs) with seamless UX.

Do this

  1. Confirm the workload survives interruption — the golden rule: if it can handle a 2-minute-notice shutdown and resume, Spot is a candidate.
  2. Diversify with instance-type flexibility — allow c5.large, c5a.large, c5n.large across multiple AZs; independent Spot prices and interruption rates dramatically improve availability.
  3. Handle the 2-minute warning gracefully — finish or checkpoint the current task to persistent storage (S3/EFS/DB), deregister from load balancers, shut down cleanly; test it in dev, don't wait for the real thing.
  4. Set max price to On-Demand so a rare spike never terminates you or costs more than standard rates.
  5. Check the Spot Instance Advisor / interruption-frequency data and prefer current-gen types (m5/c5/r5/Graviton) with good availability.

Gotchas

  • Databases and stateful apps without checkpointing are a bad fit — an interruption mid-write is data risk, not a cost win.
  • Single-type, single-AZ requests are fragile — when that pool gets scarce or pricey your fleet collapses; diversification is the fix.
  • Older generations have poor availability — stick to current-gen.
  • The 2-minute window is the whole design constraint — architecture without graceful shutdown eventually loses work.

Skip this if

Run this audit with your AI assistant

Paste this into Claude, ChatGPT, or any agent that can run the AWS CLI with read-only credentials. It audits your account for exactly the waste this sheet describes — and changes nothing.

You are auditing an AWS account for EC2 Spot Instance opportunities. Use
the AWS CLI with READ-ONLY credentials. Do not create, modify, or delete
anything — report findings and recommended (unapplied) fixes only.

1. Candidate workloads: from describe-instances + tags identify fault-
   tolerant / stateless / checkpointable On-Demand workloads (batch, ETL,
   rendering, CI/CD build agents, ML training) that could move to Spot.
   Exclude databases, stateful apps without checkpointing, and strict-
   uptime customer-facing services.
2. Diversification: recommend instance-type flexibility (e.g. c5/c5a/c5n
   .large) across multiple AZs; cite Spot interruption-frequency data /
   Spot Instance Advisor for the chosen types.
3. Interruption handling: confirm the workload catches the 2-minute
   warning (metadata + CloudWatch event) to checkpoint/drain/shut down
   cleanly; recommend max price = On-Demand.
4. Savings: estimate per-workload savings (Spot typically 50-90% off;
   e.g. m5.xlarge ~$0.192/hr On-Demand vs ~$0.038 Spot).

Report a table: workload | Spot-ready? | recommended types/AZs | max
price | est. $/mo saved. Change nothing.
Works with any assistant that can run shell commands.

Want the guided version?

The Spot Instances walkthrough covers this topic interactively — it asks about your setup, branches to what’s relevant, and quizzes you on the tricky parts. Free and anonymous.

Start the walkthrough