CLF-C02
Deep Dive
D3 is the domain with the highest weight (34%). AWS offers multiple compute options. The CLF-C02 exam tests scenarios where you must choose the right service: EC2 vs Lambda, On-Demand vs Reserved vs Spot, ECS vs EKS vs Fargate.
Contents
EC2
IaaS
VMs with full control
Lambda
Serverless
Code with no servers
ECS/EKS
Containers
Container orchestration
Beanstalk
PaaS
Managed app deployment
Elastic Compute Cloud — virtual servers in the AWS cloud
Amazon EC2 provides secure, resizable compute capacity in the cloud. It lets you provision instances (virtual servers) with the operating system, CPU type, RAM, and storage you need.
Key EC2 concepts
Instance Types
Combinations of CPU, memory, storage, and network. E.g.: t3.micro (general purpose), c5.xlarge (compute-optimized), r5.large (memory-optimized).
AMI (Amazon Machine Image)
A template containing the OS and software. It's the "image" an instance is launched from. Can come from AWS, the AWS Marketplace, or be custom.
Security Groups
A virtual firewall at the instance level. They are stateful: if you allow inbound traffic, the outbound response is automatically allowed. Only Allow rules exist (no Deny).
Key Pairs
A public/private key pair for SSH access (Linux) or to decrypt the Windows password. AWS keeps the public key, you keep the private one.
User Data
A script that runs the first time the instance launches. Useful for installing software, applying settings, etc.
Instance Store vs EBS
Instance Store = ephemeral storage (lost when the instance stops). EBS = persistent storage (survives stops and reboots).
Instance type families
| Family | Optimized for | Examples |
|---|---|---|
| t, m | General purpose | t3.micro, m5.large |
| c | Compute (CPU) | c5.xlarge, c6g.medium |
| r, x, z | Memory (RAM) | r5.large, x1e.32xlarge |
| i, d, h | Storage | i3.xlarge, d3.xlarge |
| p, g, inf | GPU / ML | p3.2xlarge, g4dn.xlarge |
| a1, c6g | ARM (Graviton) | c6g.medium (more cost-effective) |
On-Demand
Baseline price (reference)Pay for the compute time of the instances you use (per hour or per second). No long-term commitment or upfront payment.
When to use
Apps with unpredictable workloads. Development and testing. Users who do NOT want a long-term commitment.
Reserved Instances (RI)
Up to 72% vs On-DemandA commitment to use a specific instance configuration for 1 or 3 years. Paid all upfront, partial upfront, or monthly.
When to use
Apps with steady state and predictable usage. Production workloads running 24/7. When you know exactly which instance type you'll need for at least a year.
Savings Plans
Up to 66% vs On-DemandA commitment to spend ($/hour) for 1 or 3 years. More flexible than Reserved — applies to any instance type, region, or family (Compute Savings Plans).
When to use
When you want Reserved-level savings but with more flexibility. Stable workloads that may still change instance type or region.
Spot Instances
Up to 90% vs On-DemandUse AWS's spare capacity at the market spot price. AWS can interrupt the instance with a 2-minute warning when it needs that capacity back.
When to use
Interruption-tolerant workloads: image processing, rendering, big data analysis, HPC. NOT for critical production.
Dedicated Hosts
Variable — no capacity discountA physical server fully dedicated to your use. You see the physical socket, cores, and host identifiers.
When to use
Software licenses that require physical sockets/cores (BYOL). Compliance requirements that prohibit shared hardware. More expensive than the other options.
AWS organizes EC2 instances into families based on their optimization target. The instance name encodes family, generation, and size: t3.micro = family T, generation 3, size micro.
| Family | Series | Optimization | Use cases |
|---|---|---|---|
| General purpose | M, T (t2/t3/t4g) | Balanced CPU/memory | Web servers, small applications, dev databases |
| Compute optimized | C (c5/c6/c7g) | High-performance processors | Batch processing, gaming, HPC, video encoding |
| Memory optimized | R, X, z (r5/x1e/z1d) | Large amounts of RAM | In-memory databases, real-time Big Data, SAP HANA |
| Storage optimized | I, D, H (i3/d3/h1) | High sequential and random I/O | Data warehousing, distributed file systems, Hadoop |
| Accelerated computing | P, G, Inf (p3/g4dn/inf1) | GPUs / hardware accelerators | ML training and inference, 3D rendering, gaming |
Instance naming
AWS Auto Scaling
Automatically adjusts the number of EC2 instances based on demand. Define a scaling group with a minimum, desired, and maximum capacity.
Minimum
Always running (e.g.: 2)
Desired
Normal state (e.g.: 4)
Maximum
Scaling limit (e.g.: 10)
Elastic Load Balancing (ELB)
Distributes incoming traffic across multiple EC2 instances, containers, or IPs in one or more AZs.
ALB — Application LB
Layer 7 HTTP/S. Routing by URL, headers, HTTP methods. For web apps and microservices.
NLB — Network LB
Layer 4 TCP/UDP/TLS. Ultra-low latency, millions of req/sec. For high-performance applications.
GWLB — Gateway LB
For third-party security appliances (firewalls, IDS). Layer 3.
CLB — Classic LB
Legacy. Do not use for new applications. Use ALB or NLB instead.
Auto Scaling + ELB = Elastic, highly available architecture
ELB spreads traffic across healthy instances. Auto Scaling adds or removes instances based on load. Together they let the application handle any traffic level without manual intervention, with multi-AZ high availability.
AWS Batch
Runs batch computing jobs at any scale without managing the underlying infrastructure. Define the job in a container, and AWS provisions the necessary resources automatically.
AWS Outposts
Physical AWS hardware installed in the customer's datacenter. Provides the same AWS APIs, tools, and services, but locally.
Run code without provisioning or managing servers
AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time consumed — nothing is charged when the code isn't running.
Lambda characteristics
Common Lambda triggers
Lambda pricing
Per request
$0.20 per million requests. The first 1 million are free (always, not just under the free tier).
Per duration
Billed in 1ms increments. Based on configured memory × execution time.
Amazon ECS
Elastic Container Service
Docker container orchestration managed by AWS. Simpler than Kubernetes. Native integration with AWS services.
Amazon EKS
Elastic Kubernetes Service
Managed Kubernetes on AWS. If you already use Kubernetes on another cloud or on-premises, EKS eases migration and keeps things consistent.
AWS Fargate
Serverless containers
A serverless engine for containers. Removes the need to manage EC2 instances for ECS or EKS. You pay only for the CPU and memory resources used.
Quick rule for the exam
ECS = containers on AWS, AWS-native orchestration, no prior K8s experience
EKS = you already use Kubernetes, need multi-cloud portability
Fargate = containers WITHOUT managing EC2 servers (serverless containers)
Lambda = code WITHOUT containers, event-driven, short-lived functions
AWS Elastic Beanstalk
PaaS — Deploy without managing infrastructure
Deploys and scales web applications automatically. Just upload your code and Beanstalk handles provisioning, load balancing, scaling, and monitoring.
Amazon Lightsail
Simple VPS — predictable fixed pricing
Simple virtual servers with a fixed monthly price. Designed for less technical users or small projects that need a simple VPS without the complexity of full AWS.
Deploy a sample application without manually managing EC2, Load Balancer, or Auto Scaling.
+1 more...
| Service | OS control | Infra management | Scaling | Best for |
|---|---|---|---|---|
| EC2 | Full | Customer | Manual or Auto Scaling | Lift-and-shift, full control, custom OS |
| Lambda | None | AWS 100% | Automatic down to zero | Event-driven, short functions, zero infra |
| ECS (EC2) | EC2 yes | Containers: AWS; EC2: customer | ECS Autoscaling | Containers with server control |
| ECS/EKS (Fargate) | None | AWS 100% | Automatic | Serverless containers, no EC2 management |
| EKS | Control plane: AWS | Native Kubernetes | Kubernetes HPA | K8s portability, teams with K8s expertise |
| Elastic Beanstalk | EC2 access available | AWS manages the deployment | Automatic | Devs who just want to push code |
| Lightsail | Yes (VPS) | Simple AWS UI | Manual | Simple VPS, fixed price, small projects |
Learn to launch your first compute instance on AWS and understand the IaaS model.
+2 more...
Deploy your first serverless function with AWS Lambda and configure a trigger.
+1 more...
Set up an Auto Scaling group to scale EC2 automatically based on demand.
+1 more...
No guided steps: read a scenario with several stacked requirements and pick, out of 4 compute services, the only one that meets all of them.
+1 more...
Did you get this topic?
Test what you just learned
A company runs a production web application that operates 24/7, 365 days a year, with no planned interruptions. The team wants to reduce EC2 compute costs as much as possible. The app has a stable, predictable load profile. Which EC2 pricing model is recommended?
Put what you learned to the test with original CLF-C02 exam questions.
Start CLF-C02 mock examUnlimited mock exams with the Pro plan
Log in to track your progress.