Lesson 0002: Amazon EC2 Fundamentals

Virtual servers, instance families, purchasing options, and storage

1. What Is Amazon EC2?

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.

Core idea: EC2 replaces the need to buy physical servers. You rent virtual machines by the hour or second, scaling up or down based on demand.

2. Amazon Machine Images (AMIs)

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.

Exam tip: AMIs are Region-specific. An AMI created in us-east-1 cannot be used directly in eu-west-1. You must copy it to the target Region first.

3. Instance Families

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.

FamilyBest ForMemory 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
Memory trick: Tiny dev/test, Main production, Compute heavy, RAM heavy, I/O heavy, Graphics/GPU.

4. Purchasing Options

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).

OptionCommitmentDiscountBest For
On-DemandNone. 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-DemandSteady-state workloads with predictable usage (e.g., a database running 24/7).
Savings Plans1 or 3 years, commit to $/hour of compute.Similar to RIsFlexible commitment across instance families, Regions, and operating systems. Good when usage is predictable but exact instance type may change.
Spot InstancesNone, but AWS can reclaim with 2 minutes notice.Up to 90% off On-DemandFault-tolerant, flexible workloads: batch processing, CI/CD, big data, rendering. Not for critical real-time services.
Dedicated HostsPhysical server dedicated to you.On-Demand or Reserved pricingSoftware licensing that requires physical cores/sockets (BYOL). Compliance requiring single-tenancy at the hardware level.
Dedicated InstancesInstances run on hardware dedicated to you.Higher than On-DemandIsolation at the server level without needing to manage the physical host itself. Less control than Dedicated Hosts.
Capacity ReservationsReserve capacity in a specific AZ.On-Demand pricingGuarantee you have access to capacity in an AZ for critical short-term needs (e.g., a product launch) without a long-term commitment.

On-Demand vs. Spot vs. Reserved: A Decision Framework

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).

5. EC2 Storage: EBS vs. Instance Store

Every EC2 instance needs storage. The exam tests whether you know the difference between the two block-level storage options.

FeatureAmazon EBSInstance Store
PersistencePersists independently of the instance lifecycle. Data survives stop/start.Ephemeral. Data is lost when the instance is stopped or terminated.
PerformanceHigh, but network-attached. Good for most workloads.Very high, physically attached to the host. Best for temp files, caches, buffers.
BackupSnapshots to Amazon S3. Can create new volumes from snapshots.Cannot be backed up with snapshots. You must manage durability yourself.
Use caseBoot volumes, databases, file systems, any data that must survive.Temporary scratch space, high-performance caches, buffers.
Exam trap: A question may describe a database that "must survive an instance failure." The answer is EBS, not instance store. A question about "temporary rendering files" or "high-performance cache" points to instance store.

6. Security Groups (Preview)

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:

  1. Security Groups are stateful: if you allow inbound traffic, the return traffic is automatically allowed.
  2. Security Groups operate at the instance level (subnet-level control is handled by Network ACLs, which we will cover later).

7. Quick Quiz

Test Your Understanding

Select one answer per question. You will receive immediate feedback.

1. A startup is running a prototype web application with unpredictable traffic. They need maximum flexibility and no upfront commitment. Which EC2 purchasing option is most appropriate?
2. A company needs to run a high-performance computing cluster for genomic analysis. The jobs can be restarted if interrupted. Which purchasing option offers the lowest cost?
3. Which EC2 instance family is optimized for memory-intensive workloads such as in-memory databases?
4. A company requires software licensing tied to physical CPU sockets. Which EC2 purchasing option should they choose?
5. An application stores temporary session data that can be recreated if lost. Which storage type provides the highest performance for this use case?
6. A company has stable, predictable compute usage and wants flexibility to change instance families over a 3-year term. Which option is best?
7. Which statement about Amazon EBS is correct?
8. A company needs to guarantee EC2 capacity is available in a specific Availability Zone for a product launch next month, without a long-term contract. What should they use?
Progress: 0/8 correct (0%). Answer all questions to see the final recommendation.
Primary Source: AWS Academy Module 6: Compute.
Ask your teacher: If you are unclear on the purchasing option decision tree, or if you confuse instance families, ask before continuing. The exam frequently presents a scenario and asks which option saves the most money or meets a compliance need.