CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Amazon EC2 — Elastic Compute
Resizable virtual servers. Your default compute building block when you need OS-level control.
What it is
Virtual machines you control at the OS level, billed per second, in dozens of instance families.
When I reach for it
- You need full control of the OS, kernel, or long-running processes.
- Lift-and-shift of existing servers.
- Steady or spiky workloads where you manage scaling with an Auto Scaling group.
Key architectural decisions
- Family = shape of the workload:
t/mgeneral,ccompute-bound,r/xmemory-bound,i/dstorage-heavy,g/pGPU. - Pricing = shape of the demand: On-Demand for spiky, Savings Plans/Reserved for baseline, Spot for interruptible.
- Put instances in multiple AZs behind a load balancer; never pin production to one AZ.
Gotchas & exam traps
- Instance store is ephemeral — data is lost on stop/terminate. Use EBS for persistence.
- Security groups are stateful; NACLs are stateless.
- "Most cost-effective for a fault-tolerant batch job" almost always means Spot.
The architect view
EC2 is the flexible default, but flexibility is a cost. If the workload is event-driven or stateless, ask whether Lambda or Fargate removes the servers entirely before you reach for EC2.