Cloud Intermediate
AWS EC2 — Complete Guide¶
AWSEC2Auto ScalingCompute 5 min read
Elastic Compute Cloud on AWS. Instance types, AMI, Auto Scaling, Spot and Reserved instances.
Instance Types¶
- General Purpose (t3, m6i) — balanced CPU/RAM ratio, ideal for web servers
- Compute Optimized (c6i, c7g) — HPC, batch processing
- Memory Optimized (r6i, x2idn) — in-memory databases, real-time analytics
- Storage Optimized (i3, d3) — high sequential I/O, data warehousing
- Accelerated (p4d, g5) — GPU for ML training and inference
Auto Scaling Group¶
aws autoscaling create-auto-scaling-group \
--auto-scaling-group-name my-asg \
--launch-template LaunchTemplateName=my-tpl,Version='$Latest' \
--min-size 2 --max-size 10 --desired-capacity 4 \
--vpc-zone-identifier "subnet-abc,subnet-def"
ASG automatically scales the number of instances based on metrics (CPU, request count, custom).
Pricing Models¶
- On-Demand — pay per second, no commitment
- Reserved Instances — 1–3 years, up to 72% discount
- Savings Plans — more flexible alternative to RI
- Spot Instances — up to 90% discount, 2-min warning before reclamation
Summary¶
EC2 is the foundation of AWS compute. Combine RI for baseline + Spot for burst + Graviton for price-performance.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.