Virtual servers, instance families, purchasing options, and storage
Amazon Elastic Compute Cloud (EC2) provides resizable virtual servers in the cloud. You choose an operating system, CPU, memory, storage, and networking capacity, then launch as many instances as you need. EC2 is the most fundamental AWS compute service and appears on virtually every CLF-C02 exam.
An AMI is a template that contains the software configuration (operating system, application server, applications) required to launch an EC2 instance. You can use AWS-provided AMIs, marketplace AMIs, or create your own.
The exam does not ask you to memorize specs. It asks you to pick the right family for a workload. Focus on the first letter of the instance family name.
| Family | Best For | Memory Pattern |
|---|---|---|
| T (e.g., t3.micro) | Burstable, general-purpose workloads. Ideal for low-traffic web servers, small databases, dev/test environments. Cheapest entry point. | Baseline CPU with burst credits |
| M (e.g., m6i.large) | General-purpose production workloads. Balanced compute, memory, and networking. Good when you do not need extreme optimization in any one dimension. | Balanced |
| C (e.g., c6i.xlarge) | Compute-intensive tasks: batch processing, media transcoding, high-performance web servers, gaming servers, scientific modeling. | High CPU relative to memory |
| R (e.g., r6i.large) | Memory-intensive workloads: in-memory caches, real-time big data analytics, high-performance databases. | High memory relative to CPU |
| I (e.g., i4i.large) | Storage-optimized workloads: NoSQL databases, data warehousing, large transactional databases that need high random I/O. | High local SSD storage |
| G (e.g., g5.xlarge) | GPU-intensive workloads: machine learning inference, graphics rendering, video encoding, gaming. | GPU-accelerated |
The exam heavily tests EC2 purchasing models. You must know when each is appropriate and the trade-offs involved. These models also appear in Domain 4 (Billing).
| Option | Commitment | Discount | Best For |
|---|---|---|---|
| On-Demand | None. Pay per hour/second. | None (highest cost) | Short-term, spiky, or unpredictable workloads. Testing new applications. |
| Reserved Instances (RI) | 1 or 3 years. | Up to 72% off On-Demand | Steady-state workloads with predictable usage (e.g., a database running 24/7). |
| Savings Plans | 1 or 3 years, commit to $/hour of compute. | Similar to RIs | Flexible commitment across instance families, Regions, and operating systems. Good when usage is predictable but exact instance type may change. |
| Spot Instances | None, but AWS can reclaim with 2 minutes notice. | Up to 90% off On-Demand | Fault-tolerant, flexible workloads: batch processing, CI/CD, big data, rendering. Not for critical real-time services. |
| Dedicated Hosts | Physical server dedicated to you. | On-Demand or Reserved pricing | Software licensing that requires physical cores/sockets (BYOL). Compliance requiring single-tenancy at the hardware level. |
| Dedicated Instances | Instances run on hardware dedicated to you. | Higher than On-Demand | Isolation at the server level without needing to manage the physical host itself. Less control than Dedicated Hosts. |
| Capacity Reservations | Reserve capacity in a specific AZ. | On-Demand pricing | Guarantee you have access to capacity in an AZ for critical short-term needs (e.g., a product launch) without a long-term commitment. |
Can the workload survive interruption? Yes → Consider Spot (cheapest). No → Continue.
Is usage steady and predictable for 1-3 years? Yes → Reserved Instances or Savings Plans (best discount for stable workloads). No → Continue.
Do you need guaranteed hardware isolation or socket-level licensing? Yes → Dedicated Hosts. No → On-Demand (default, flexible, most expensive).
Every EC2 instance needs storage. The exam tests whether you know the difference between the two block-level storage options.
| Feature | Amazon EBS | Instance Store |
|---|---|---|
| Persistence | Persists independently of the instance lifecycle. Data survives stop/start. | Ephemeral. Data is lost when the instance is stopped or terminated. |
| Performance | High, but network-attached. Good for most workloads. | Very high, physically attached to the host. Best for temp files, caches, buffers. |
| Backup | Snapshots to Amazon S3. Can create new volumes from snapshots. | Cannot be backed up with snapshots. You must manage durability yourself. |
| Use case | Boot volumes, databases, file systems, any data that must survive. | Temporary scratch space, high-performance caches, buffers. |
EC2 instances are protected by Security Groups — virtual firewalls that control inbound and outbound traffic at the instance level. We will cover Security Groups in depth in the Networking lesson, but you need to know two facts now:
Select one answer per question. You will receive immediate feedback.