Based on the DVA-C02 exam guideReport an error
Every EC2 layer we covered in Week 2 — Nitro, instance families, AMIs, Security Groups, Key Pairs, User Data, EBS, Instance Store, ALB, NLB, ASG — is a poor fit for rote memorization. The exam always frames things as scenarios, and those scenarios ask questions like "The SG is wide open, so why doesn't it work?", "Why doesn't the new instance show up in the ALB?", or "Why did our cross-AZ traffic bill explode?" You can't answer these by looking at each layer in isolation; you have to see how the layers mesh and operate together.
Today we tie every Week 2 concept into one production-grade architecture, then work through the traps and exam scenarios you hit most often on top of it. At the end, 12 scenario-based synthesis questions to gauge your real exam readiness.
Assume we're building a classic 3-tier web service on EC2. The shape is user → CloudFront → ALB → ASG(EC2) → RDS Multi-AZ + ElastiCache. Let's locate each Week 2 concept within this structure.
[Route 53 (DNS, alias to ALB)]
│
▼
[CloudFront (edge cache + WAF)]
│
▼
[ALB in 3 AZs (cross-zone ON, ACM cert)]
HTTPS:443 ┌──────┴──────┐
▼ ▼
(path /api/*) (path /*)
│ │
▼ ▼
[api-tg] [web-tg]
(target=instance, /healthz)
│ │
┌──────────┴─────────────┴──────────┐
▼ ▼
[ASG: Mixed Instance Policy]
Min 3, Max 30, Desired 6
┌─ AZ-a ─┐ ┌─ AZ-b ─┐ ┌─ AZ-c ─┐
│ EC2 #1 │ │ EC2 #3 │ │ EC2 #5 │
│ EC2 #2 │ │ EC2 #4 │ │ EC2 #6 │
│ gp3 root│ │ gp3 root│ │ gp3 root│
│ io2 data│ │ io2 data│ │ io2 data│
└────────┘ └────────┘ └────────┘
│
IAM Instance Profile (S3 read, Secrets Manager read)
User Data: fetch DB pass from Secrets Manager
IMDSv2 required, hop-limit 1
│
▼
[Security Group: web-sg]
Inbound: 443 from ALB SG
22 from Bastion SG
Outbound: 3306 to db-sg, 6379 to cache-sg, 443 to 0.0.0.0/0
│
▼
┌─ AZ-a ──┐ ┌─ AZ-b ──┐
[RDS Multi-AZ Primary/Standby (synchronous), db-sg]
[ElastiCache Redis Cluster (Multi-AZ, cache-sg)]
Let's trace how each Week 2 concept works inside this architecture.
Starting point - a user requests https://app.example.com
app.example.com certificate via SNI (issued by ACM, auto-renewed)When Auto Scaling launches one more instance
aws secretsmanager get-secret-value and writes it to /etc/app/secrets.env with chmod 600EC2_INSTANCE_LAUNCHING lifecycle hook holds the instance in Pending:Waitcomplete-lifecycle-action/healthz returns 200 five times in a row → healthy. Only now does it start receiving trafficWhen an instance dies or is scaled in
HealthCheckType=ELB, it decides to terminate that instanceEC2_INSTANCE_TERMINATING lifecycle hook holds it in Terminating:Waitcomplete-lifecycle-action, the instance terminates; the EBS volume is deleted alongside it if DeleteOnTermination=trueEvery concept that appears in this sequence is in Week 2's exam scope. The exam asks its questions by breaking one step somewhere in this sequence and framing it as a scenario.
Usually one of: ① a missing ephemeral-port outbound rule on the NACL, ② a missing inbound rule on the Endpoint SG (PrivateLink), ③ conntrack limit exceeded (per instance type), or ④ a missing IGW/NAT route in the Route Table. Don't stare at the SG alone — follow the entire packet path.
The moment the health check passes is not the moment the application is fully ready. Point the health check path at /healthz and have the application respond 200 only when its ready flag is true, or use an ASG lifecycle hook to buy warmup time.
Happens when NLB cross-zone is on and target counts differ per AZ, or when two AWS accounts have mismatched ZoneName mappings and PrivateLink ends up flowing cross-AZ. Align on ZoneId.
This is lazy loading. Turn on Fast Snapshot Restore, or read every block once with dd.
Anyone can read it from IMDS. Switch to Secrets Manager + instance profile.
Change the lowest-price strategy to capacity-optimized or price-capacity-optimized. Register several instance types in the Override list.
st1 and sc1 can't boot. Only SSD (gp2/gp3/io1/io2) is bootable.
Not possible with plain gp3. You need io1/io2 + Nitro + same AZ + Multi-Attach + a cluster file system. Usually EFS is the better answer.
Permanent data loss. If you need durable storage use EBS; if you need sharing use EFS/S3.
Enforce IMDSv2 (HttpTokens=required, HttpPutResponseHopLimit=1). The root cause of the Capital One breach.
target-type=ip but the security group doesn't matchIP-type target SG referencing behaves differently from instance-type targets. You have to allow the ENI's SG on inbound precisely.
If Target Tracking is on, it re-adjusts desired against the metric every time. If you need a manual adjustment, pause the policy or use suspend-processes.
| A | B | Key difference |
|---|---|---|
| Instance Store | EBS | Ephemeral (host-bound) vs durable (network disk) |
| Stop | Terminate | EBS retained (optional) vs deleted by default (DeleteOnTermination) |
| Stop | Hibernate | RAM lost vs RAM dumped to EBS then stopped |
| Reboot | Stop+Start | Same host vs different host (public IP changes) |
| Reserved Instance | Savings Plan | Commit to instance family/region vs commit to dollars-per-hour |
| Standard RI | Convertible RI | Family fixed vs family exchangeable (higher price) |
| Compute SP | EC2 Instance SP | Applies across many services vs specific family/region only |
| Public IP | Elastic IP | Volatile/free vs fixed, billed when idle, and since 2024 billed even while in use |
| Security Group | NACL | Instance-level stateful Allow-only vs subnet-level stateless Allow+Deny |
| ALB | NLB | L7 HTTP routing vs L4 TCP/UDP with static EIP |
| ALB | API Gateway | LB invoking Lambda vs rich API management features |
| Cluster PG | Spread PG | Same rack (low latency) vs different racks (HA) |
| Cluster PG | Partition PG | Single group vs multiple partitions (Cassandra rack-awareness) |
| Target Tracking | Step Scaling | Automatic target-value tracking vs explicit threshold steps |
| gp3 | gp2 | IOPS/throughput set independently vs tied to size |
| io1 | io2 | 99.9% vs 99.999% durability + IOPS:GB 1:50 vs 1:500 |
| EBS | EFS | Block, single instance vs NFS, multiple instances |
| EFS | FSx for Lustre | General NFS vs HPC parallel FS |
| Cross-Zone ALB | Cross-Zone NLB | Default ON, free vs default OFF, cross-AZ data transfer cost when enabled |
| Sticky ALB | Sticky NLB | Cookie-based vs Source IP affinity |
| IMDSv1 | IMDSv2 | GET-only → SSRF vulnerable vs PUT token + GET header, safe |
| User Data | cfn-init | One-shot bootstrap vs fine-grained init based on CloudFormation metadata |
| Lifecycle Hook (Launching) | Lifecycle Hook (Terminating) | Delay InService during warmup vs delay termination during graceful shutdown |
| capacity-optimized | lowest-price | Low reclamation (production) vs low cost (batch) |
| Acronym | Full name |
|---|---|
| EC2 | Elastic Compute Cloud |
| AMI | Amazon Machine Image |
| EBS | Elastic Block Store |
| EFS | Elastic File System |
| FSx | (product family - Lustre, Windows, NetApp ONTAP, OpenZFS) |
| EIP | Elastic IP |
| IMDS | Instance Metadata Service (v1/v2) |
| ELB | Elastic Load Balancing |
| ALB / NLB / CLB / GWLB | Application/Network/Classic/Gateway Load Balancer |
| ASG | Auto Scaling Group |
| RI | Reserved Instance |
| SP | Savings Plan |
| PG | Placement Group |
| NACL | Network Access Control List |
| DLM | Data Lifecycle Manager |
| FSR | Fast Snapshot Restore |
| SNI | Server Name Indication |
| TLS | Transport Layer Security |
| ACM | AWS Certificate Manager |
| mTLS | mutual TLS (client certificate) |
| VPC | Virtual Private Cloud |
| IGW | Internet Gateway |
| NAT | Network Address Translation |
| IOPS | Input/Output Operations Per Second |
| EFA | Elastic Fabric Adapter |
| DEK | Data Encryption Key (KMS envelope encryption) |
| AES-XTS | Advanced Encryption Standard - XEX-based Tweaked-codebook with ciphertext Stealing |
| CMK | Customer Master Key (KMS) |
| LCU/NLCU/GLCU | Load Balancer Capacity Unit (ALB/NLB/GWLB) |
| MRK | Multi-Region Key (KMS) |
DVA covers the same EC2 scope as SAA, but the exam's vantage point is different. Even for the same ASG, DVA drills down to the code, SDK, and option-name level: ① how you handle the IMDSv2 token in boto3, ② how CodeDeploy's Blue/Green manipulates the ALB target group, ③ how you mount EFS from Lambda, ④ at what point the instance profile permissions are attached when you call Secrets Manager inside User Data.
| DVA vantage point |
|---|
| boto3 handles the IMDSv2 token automatically (botocore 1.13+) |
| Lambda → EFS mount (requires an access point) |
| ALB → invoking Lambda directly (event format differs from API Gateway) |
| Calling Secrets Manager via the instance profile inside User Data |
| The mechanism by which CodeDeploy integrates with ASG + ALB |
| SNS/SQS notification target of a lifecycle hook |
| KMS Multi-Region Key when doing an EBS multi-region snapshot copy |
Week 2 took in the whole EC2 layer. We started from EC2's own virtualization, instance families, and AMIs, then moved up through the network controls on top (SG, Key Pair, User Data), the disk layer (EBS, Instance Store, EFS/FSx), and finally the traffic-distribution layer (ALB/NLB, ASG) — following how one production architecture is woven together. Since the exam bundles all of this into a single scenario, you need to be able to picture "the full path an instance travels before it receives traffic" in your head, rather than memorizing each layer separately.
From Week 3 on, the DVA-specific layers — IAM, Lambda, DynamoDB, API Gateway, CodePipeline — stack on top of this EC2 layer. Only when the EC2 layer is firmly in place do the developer-vantage layers above it settle cleanly.
Click a choice to reveal the answer and explanation.
Question 1
An e-commerce company's ALB + ASG production system spikes to 20x its normal RPS during the first 5 minutes of a sale that starts at 7 PM daily. It uses a Target Tracking (CPU 60%) scaling policy, but users are getting 5xx. What is the most appropriate improvement?
Question 2
A company runs ML training on an EC2 instance every midnight and uploads the results to S3. It wants to minimize cost, and the job only needs to finish within 24 hours. What is the most appropriate purchase option?
Question 3
A developer trying to pull IAM credentials from an EC2 instance's IMDS finds that curl http://169.254.169.254/latest/meta-data/iam/security-credentials/MyRole returns a 401. What is the most likely cause?
Question 4
A company runs two EC2 instances that must read and write in the same directory. Concurrent access is required, and the two EC2s are in different AZs. What is the most appropriate solution?
Question 5
A company runs microservices behind an ALB. api.example.com/orders/* must go to the orders service and api.example.com/users/* to the users service. The two services each run on their own ASG. What is the most accurate configuration?
Question 6
An EC2 instance calls aws s3 cp s3://bucket/app.tar.gz /opt/ inside user-data but gets an Unable to locate credentials error. What is the most likely cause?
Question 7
A company wants to encrypt a production EC2's EBS volume (unencrypted gp2). To minimize downtime, what should it do?
Question 8
A company finds that a new instance starts receiving traffic the moment it registers with the ALB target group and returns 5xx before the application warms up. What is the most appropriate response?
Question 9
A company distributes game-server traffic with an NLB. Users are spread evenly across 5 AZs, but the instance count per AZ differs (AZ-a 10, AZ-b 5, AZ-c 2). A report comes in that traffic is uneven. What is the most appropriate action?
Question 10
An ML team needs to load a 2GB ML model in a Lambda function. It exceeds the Lambda layer limit (250MB). What is the most appropriate solution?
Question 11
An instance sporadically returns Connection refused. CPU and memory have headroom and the SG is wide open. CloudWatch shows the conntrack_allowance_exceeded metric. What is the most appropriate response?
Question 12
A company runs EC2 production behind an ALB + ASG. It wants to set up Blue/Green deployment with CodeDeploy — which ALB feature does it use?
| Score | Assessment |
|---|---|
| 11-12 | Excellent - proceed to Week 3, full command of the EC2 layer |
| 8-10 | Good - review the missed questions before proceeding, especially re-check the 12 traps |
| 5-7 | Fair - relearning the EC2 layer recommended, especially ASG and lifecycle hooks |
| 0-4 | Weak - restart Week 2 from the beginning. Read each layer (SG, EBS, ALB) closely |
HttpTokens=required) is the standard SSRF defense.