📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials AWS Solutions Architect EC2 — Virtual Servers in the Cloud

EC2 — Virtual Servers in the Cloud

6 min read Quiz at the end
Learn EC2 instance types, pricing models, security groups, and when to use each. This is the most heavily tested EC2 topic in SAA-C03.

EC2 — Elastic Compute Cloud

EC2 gives you virtual servers (called instances) in the cloud. You choose the size, operating system, and configuration. AWS manages the physical hardware.

Teacher Note: Think of EC2 like renting a laptop from AWS. You choose: small laptop (t3.micro) or powerful workstation (m5.4xlarge). You install your own software. You can start it, stop it, or upgrade it anytime.

Instance Families — Choosing the Right Size

FamilyOptimised ForExample Use CaseExamples
TBurstable — general purpose, variable loadDev servers, small websitest3.micro, t3.medium
MBalanced CPU and MemoryWeb servers, app serversm6i.large, m7g.xlarge
CCompute — high CPUVideo encoding, batch processing, gamingc6i.xlarge, c7g.2xlarge
RMemory — lots of RAMDatabases, caches, in-memory analyticsr6i.xlarge, r7g.2xlarge
IStorage — fast NVMe SSDsHigh-performance databases, Kafkai3.xlarge, i4i.2xlarge
P/GGPU — graphics processingMachine learning training, renderingp3.2xlarge, g5.xlarge

Pricing Models — Pay Less, Smartly

ModelDiscountBest ForCommitment
On-Demand0% (baseline)Short-term, unpredictable workloadsNone
Reserved Instances40-60%Steady 24/7 workloads (databases, app servers)1 or 3 years
Savings Plans40-60%Flexible — works across instance families1 or 3 years
Spot Instances70-90%Fault-tolerant batch jobs, rendering, ML trainingNone — can be interrupted
Dedicated HostsVariesCompliance, BYOL (Oracle, Windows licenses)On-demand or reserved

EC2 Key Concepts for the Exam

  • Security Groups: virtual firewall — stateful, allow-only rules, applies at instance level
  • User Data: shell script that runs ONCE on first boot — for bootstrapping/configuration
  • AMI (Amazon Machine Image): snapshot of an OS + installed software — used to launch instances
  • Elastic IP: static public IP address that you own — survives instance stops
  • Instance Store: fast temporary storage physically attached — DATA LOST when instance stops
Exam Tip: Spot Instances = up to 90% cheaper BUT can be interrupted with 2-minute warning. NEVER use Spot for production databases. USE Spot for: batch jobs, Hadoop, rendering, and stateless web servers that can restart safely.
Topic Quiz · 3 questions

Test your understanding before moving on

1. A company runs a batch data processing job every weekend. The job can be interrupted and restarted safely. Which EC2 pricing model minimises cost?
💡 Spot Instances provide up to 90% discount for fault-tolerant, interruptible workloads like batch processing.
2. An application needs consistent high performance 24/7 for the next 3 years. Which pricing model provides the BEST cost savings?
💡 Reserved Instances provide 40-60% savings for long-term steady workloads with a 1 or 3 year commitment.
3. What is an AMI?
💡 AMIs (Amazon Machine Images) are templates containing OS + software used to launch EC2 instances quickly.