CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
  • Week 1
    • 1.AWS from a Developer's Perspective: Regions, Infrastructure, and the Boundary of Responsibility
    • 2.The 4 Core Entities of IAM: User, Group, Role, Policy
    • 3.STS and Policy Conditions: The Deep World of Temporary Credentials
    • 4.AWS CLI and SDK: From Credential Chaining to SigV4
    • 5.Week 1 Review: The Chain of Trust Built by Infrastructure and IAM
  • Week 2
    • 1.The Anatomy of EC2: Nitro, Instance Families, and What's Inside an AMI
    • 2.The Network Boundary a Developer Actually Touches: Security Groups, Key Pairs, User Data
    • 3.EC2's Disk Layer: EBS, Instance Store, and EFS and FSx on Top of Them
    • 4.The Traffic-Distribution Layer: ALB, NLB, GWLB, and the Auto Scaling Group
    • 5.Week 2 Synthesis: How the EC2 Layers Mesh Inside a Single System
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← DVA-C02/Week 2/Day 5

Based on the DVA-C02 exam guide·Report an error

DVA-C02· AssociateWeek 2 · Day 5~50 min read

Day 5 - Week 2 Synthesis: How the EC2 Layers Mesh Inside a Single System

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.

How All of Week 2 Meshes Inside a Single System

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

  1. Route 53 receives the DNS query and answers with the ALB's alias record
  2. The ALB presents the app.example.com certificate via SNI (issued by ACM, auto-renewed)
  3. The ALB listener rule decides web-tg or api-tg by path-pattern
  4. The ALB forwards to one of the healthy targets. With cross-zone ON, it spreads evenly across AZs
  5. The ALB SG's outbound matches web-sg's inbound 443
  6. nginx on the EC2 instance reverse-proxies 8080 → the application

When Auto Scaling launches one more instance

  1. ALB RequestCountPerTarget hits 1500 in CloudWatch → the ASG's Target Tracking bumps desired +1
  2. The ASG starts a new EC2 from the launch template. With Mixed Instance Policy it picks capacity-optimized across c5.large or c5a.large
  3. The Nitro hypervisor assigns a host, attaches the EBS gp3 root volume + io2 data volume
  4. cloud-init grabs an IMDSv2 token and fetches metadata, injecting the IAM instance profile's credentials
  5. User Data fetches the DB password with aws secretsmanager get-secret-value and writes it to /etc/app/secrets.env with chmod 600
  6. The EC2_INSTANCE_LAUNCHING lifecycle hook holds the instance in Pending:Wait
  7. The application starts, and after cache pre-warm completes it calls complete-lifecycle-action
  8. The ASG flips the instance to InService and auto-registers it in the ALB target group
  9. Health check /healthz returns 200 five times in a row → healthy. Only now does it start receiving traffic

When an instance dies or is scaled in

  1. The EC2's own status check fails, or the ALB hits the unhealthy threshold
  2. Since the ASG has HealthCheckType=ELB, it decides to terminate that instance
  3. The EC2_INSTANCE_TERMINATING lifecycle hook holds it in Terminating:Wait
  4. It notifies via SNS/SQS, a Lambda syncs the logs to S3, and the application does a graceful shutdown
  5. In-flight requests drain over the ALB's 300-second deregistration delay
  6. After complete-lifecycle-action, the instance terminates; the EBS volume is deleted alongside it if DeleteOnTermination=true

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

The Traps You Hit Most Often

Trap 1: The SG is wide open but the connection still fails

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.

Trap 2: The new instance returns 5xx from the ALB

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.

Trap 3: Cross-AZ costs explode

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.

Trap 4: Response is slow after restoring an EBS snapshot

This is lazy loading. Turn on Fast Snapshot Restore, or read every block once with dd.

Trap 5: Hardcoding a password into User Data gets flagged in a security audit

Anyone can read it from IMDS. Switch to Secrets Manager + instance profile.

Trap 6: High Spot reclamation rate keeps taking production down

Change the lowest-price strategy to capacity-optimized or price-capacity-optimized. Register several instance types in the Override list.

Trap 7: Trying to boot from an HDD volume

st1 and sc1 can't boot. Only SSD (gp2/gp3/io1/io2) is bootable.

Trap 8: Two EC2s accessing the same EBS volume at once

Not possible with plain gp3. You need io1/io2 + Nitro + same AZ + Multi-Attach + a cluster file system. Usually EFS is the better answer.

Trap 9: Storing important data on instance store, then stopping

Permanent data loss. If you need durable storage use EBS; if you need sharing use EFS/S3.

Trap 10: SSRF attack while running IMDSv1

Enforce IMDSv2 (HttpTokens=required, HttpPutResponseHopLimit=1). The root cause of the Capital One breach.

Trap 11: The ALB target group is target-type=ip but the security group doesn't match

IP-type target SG referencing behaves differently from instance-type targets. You have to allow the ENI's SG on inbound precisely.

Trap 12: Manually changing the ASG's desired capacity, but the scaling policy reverts it

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.

Week 2 Easy-to-Confuse Comparisons

ABKey difference
Instance StoreEBSEphemeral (host-bound) vs durable (network disk)
StopTerminateEBS retained (optional) vs deleted by default (DeleteOnTermination)
StopHibernateRAM lost vs RAM dumped to EBS then stopped
RebootStop+StartSame host vs different host (public IP changes)
Reserved InstanceSavings PlanCommit to instance family/region vs commit to dollars-per-hour
Standard RIConvertible RIFamily fixed vs family exchangeable (higher price)
Compute SPEC2 Instance SPApplies across many services vs specific family/region only
Public IPElastic IPVolatile/free vs fixed, billed when idle, and since 2024 billed even while in use
Security GroupNACLInstance-level stateful Allow-only vs subnet-level stateless Allow+Deny
ALBNLBL7 HTTP routing vs L4 TCP/UDP with static EIP
ALBAPI GatewayLB invoking Lambda vs rich API management features
Cluster PGSpread PGSame rack (low latency) vs different racks (HA)
Cluster PGPartition PGSingle group vs multiple partitions (Cassandra rack-awareness)
Target TrackingStep ScalingAutomatic target-value tracking vs explicit threshold steps
gp3gp2IOPS/throughput set independently vs tied to size
io1io299.9% vs 99.999% durability + IOPS:GB 1:50 vs 1:500
EBSEFSBlock, single instance vs NFS, multiple instances
EFSFSx for LustreGeneral NFS vs HPC parallel FS
Cross-Zone ALBCross-Zone NLBDefault ON, free vs default OFF, cross-AZ data transfer cost when enabled
Sticky ALBSticky NLBCookie-based vs Source IP affinity
IMDSv1IMDSv2GET-only → SSRF vulnerable vs PUT token + GET header, safe
User Datacfn-initOne-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-optimizedlowest-priceLow reclamation (production) vs low cost (batch)

Week 2 Acronym Glossary

AcronymFull name
EC2Elastic Compute Cloud
AMIAmazon Machine Image
EBSElastic Block Store
EFSElastic File System
FSx(product family - Lustre, Windows, NetApp ONTAP, OpenZFS)
EIPElastic IP
IMDSInstance Metadata Service (v1/v2)
ELBElastic Load Balancing
ALB / NLB / CLB / GWLBApplication/Network/Classic/Gateway Load Balancer
ASGAuto Scaling Group
RIReserved Instance
SPSavings Plan
PGPlacement Group
NACLNetwork Access Control List
DLMData Lifecycle Manager
FSRFast Snapshot Restore
SNIServer Name Indication
TLSTransport Layer Security
ACMAWS Certificate Manager
mTLSmutual TLS (client certificate)
VPCVirtual Private Cloud
IGWInternet Gateway
NATNetwork Address Translation
IOPSInput/Output Operations Per Second
EFAElastic Fabric Adapter
DEKData Encryption Key (KMS envelope encryption)
AES-XTSAdvanced Encryption Standard - XEX-based Tweaked-codebook with ciphertext Stealing
CMKCustomer Master Key (KMS)
LCU/NLCU/GLCULoad Balancer Capacity Unit (ALB/NLB/GWLB)
MRKMulti-Region Key (KMS)

DVA-Specific Exam Points (What Differs from SAA)

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

Wrapping Up

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.

📝 Practice Questions

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?

📊 Week 2 Self-Assessment

ScoreAssessment
11-12Excellent - proceed to Week 3, full command of the EC2 layer
8-10Good - review the missed questions before proceeding, especially re-check the 12 traps
5-7Fair - relearning the EC2 layer recommended, especially ASG and lifecycle hooks
0-4Weak - restart Week 2 from the beginning. Read each layer (SG, EBS, ALB) closely

📌 Week 2 Full Summary

  1. EC2 virtualization evolved into the Nitro System (dedicated hardware cards), and Firecracker microVMs are the foundation of Lambda and Fargate. Choosing the instance family (M/C/R/I/D/P/G/T) and Graviton (g suffix) chips is the starting point of cost optimization.
  2. A Security Group is an ENI-level stateful firewall (conntrack-based). A NACL is subnet-level and stateless. Enforcing IMDSv2 (HttpTokens=required) is the standard SSRF defense.
  3. User Data runs once as the final step of cloud-init, with a 16KB limit. Never hardcode passwords — use Secrets Manager + instance profile.
  4. EBS is AZ-bound distributed block storage. gp3 is the default, io2/Block Express for critical DBs. Snapshots are S3 incremental + Snapshot Archive (75% savings). KMS envelope encryption.
  5. Instance Store is host-attached NVMe with microsecond latency, but it's lost on stop/terminate. No durable storage.
  6. For shared files, use EFS (NFS multi-AZ), not EBS Multi-Attach. HPC uses FSx for Lustre, Windows uses FSx for Windows, enterprise uses FSx for NetApp ONTAP.
  7. Choosing between ALB (L7 HTTP routing) and NLB (L4 TCP/UDP with static EIP) is based on the workload protocol. ALB cross-zone is default ON and free; NLB is default OFF and costs money when enabled.
  8. An ASG is a reconciliation loop, with lifecycle hooks controlling warmup and graceful shutdown. Target Tracking is the default scaling policy. Mixed Instance Policy + capacity-optimized Spot is the production standard.
  9. Blue/Green deployment is implemented natively through the ALB's weighted forward integrated with CodeDeploy.
  10. Exam scenarios ask about connections between layers. Building the habit of narrowing "the SG is open but it doesn't work" down to one of NACL/Endpoint SG/conntrack/Route Table, and "5xx" down to one of health-check timing/warmup/IAM permission, is what determines your score.
PreviousThe Traffic-Distribution Layer: ALB, NLB, GWLB, and the Auto Scaling GroupWeek 2 · Day 4Next Lambda Execution Model: How Firecracker MicroVMs Run Your FunctionWeek 3 · Day 1

Official references

  • DVA-C02 official exam page(opens in a new tab)
  • Elastic Load Balancing documentation(opens in a new tab)
  • Amazon EC2 Auto Scaling documentation(opens in a new tab)
  • Amazon EC2 documentation(opens in a new tab)
  • Amazon EBS documentation(opens in a new tab)
  • Amazon EFS documentation(opens in a new tab)

On this page

  • How All of Week 2 Meshes Inside a Single System
  • The Traps You Hit Most Often
  • Trap 1: The SG is wide open but the connection still fails
  • Trap 2: The new instance returns 5xx from the ALB
  • Trap 3: Cross-AZ costs explode
  • Trap 4: Response is slow after restoring an EBS snapshot
  • Trap 5: Hardcoding a password into User Data gets flagged in a security audit
  • Trap 6: High Spot reclamation rate keeps taking production down
  • Trap 7: Trying to boot from an HDD volume
  • Trap 8: Two EC2s accessing the same EBS volume at once
  • Trap 9: Storing important data on instance store, then stopping
  • Trap 10: SSRF attack while running IMDSv1
  • Trap 11: The ALB target group is `target-type=ip` but the security group doesn't match
  • Trap 12: Manually changing the ASG's desired capacity, but the scaling policy reverts it
  • Week 2 Easy-to-Confuse Comparisons
  • Week 2 Acronym Glossary
  • DVA-Specific Exam Points (What Differs from SAA)
  • Wrapping Up
  • Week 2 Comprehensive Practice Questions (12 scenario questions)
  • Week 2 Self-Assessment
  • Week 2 Full Summary