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
  • Week 3
  • Week 4
    • 1.API Gateway REST API: The Full Path a Request Takes to Reach the Backend
    • 2.API Gateway Integration Types and VTL Mapping Templates: Calling DynamoDB Directly Without Lambda
    • 3.API Gateway Security, Caching, and Throttling: How Requests Are Controlled, from SigV4 to the Token Bucket
    • 4.WebSocket API and HTTP API: The Inner Workings of Real-Time Connections and Lightweight Proxies
    • 5.Week 4 Review: Sharpening Real Exam Instincts with Comprehensive API Gateway Scenarios
  • 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 4/Day 5

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

DVA-C02· AssociateWeek 4 · Day 5~39 min read

Day 5 - Week 4 Review: Sharpening Real Exam Instincts with Comprehensive API Gateway Scenarios

The API Gateway we covered in Week 4 is not a simple HTTP proxy. Three independent product families — REST API, HTTP API, and WebSocket API — implement different paradigms, each with different authentication methods, integration types, and performance characteristics. This review focuses less on reconfirming individual concepts and more on edge cases and selection judgment. DVA-C02 asks not "which service should I use" but "why is this configuration wrong" and "what is the root cause of this error". The scenario questions below are structured with the same kind of compound conditions that appear on the actual exam.


Full Week 4 Spec Reference

Complete Comparison of the Three API Gateway Types

FeatureREST APIHTTP APIWebSocket API
ProtocolHTTP/1.1HTTP/1.1RFC 6455 WebSocket
Communication directionRequest-responseRequest-responseBidirectional
Cost (per million calls)~$3.50~$1.00Connection time + message count
Lambda Proxy integration✅✅✅
VTL mapping templates✅❌❌
Direct AWS Service integration✅❌❌
MOCK integration✅❌❌
IAM authentication✅✅✅
Lambda Authorizer✅✅✅ ($connect only)
Cognito User Pool Authorizer✅❌❌
JWT Authorizer❌✅❌
API Key + Usage Plan✅❌❌
Resource Policy✅❌❌
mTLS✅✅❌
WAF✅ (direct)❌ (CF workaround)❌
Response caching✅❌❌
Request Validation✅❌❌
Gateway Response customization✅❌❌
X-Ray Tracing✅❌❌
Canary Deployment✅❌❌
VPC Link backendNLB onlyALB/NLB/CloudMap❌
Automatic CORS setup❌ (manual)✅N/A
Payload FormatLambda Proxy formatv1.0 or v2.0 (default)Separate

Authentication Method Selection Mapping

ScenarioRecommended auth method
AWS Lambda/EC2 calling an API in another accountIAM + SigV4
External OAuth2 / custom JWT validationLambda Authorizer (TOKEN)
Composite validation of header + query + pathLambda Authorizer (REQUEST)
Cognito User Pool users (REST API)Cognito User Pool Authorizer
Cognito/Auth0/Okta JWT (HTTP API)JWT Authorizer
Partner API usage tracking + quotaAPI Key + Usage Plan
Allow access only from inside a VPCResource Policy (SourceVpce)
IP whitelistResource Policy (SourceIp)
Cross-account API accessResource Policy (Principal ARN)
IoT device, B2B partner authenticationmTLS
SQL injection / XSS defenseWAF (REST API only, direct)

Integration Type Selection Mapping

ScenarioIntegration type
Connect Lambda in the simplest wayAWS_PROXY (Lambda Proxy)
Transform the Lambda response before returning to the clientAWS (non-Proxy) + response mapping
Call DynamoDB/SNS/SQS directly (without Lambda)AWS (non-Proxy) + VTL
Proxy an external HTTP serverHTTP_PROXY
External HTTP server + response transformationHTTP + response mapping
Hardcoded response for dev/testMOCK

Key CloudWatch Metrics Summary

MetricWhat it measuresUse
LatencyClient receipt ~ response returned (end-to-end)Overall performance monitoring
IntegrationLatencyAPI GW → backend call ~ responseIsolate backend performance
CountTotal number of API callsTraffic trends
4XXErrorClient errors like 400/401/403/429Detect misuse/auth failure/throttling
5XXErrorServer errors like 500/502/503/504Detect backend failures/timeouts
CacheHitCountNumber of times served from cacheCache efficiency
CacheMissCountNumber of times a backend call was neededCache efficiency

If Latency - IntegrationLatency is large, API GW internal processing (auth, VTL, cache lookup) is the bottleneck. If IntegrationLatency itself is large, the backend is slow.


Week 4 Key Traps Checklist

  1. Without a deploy, changes don't apply: In REST API, even if you change resources, methods, integrations, or authorizers, they aren't reflected unless you redeploy to the stage. HTTP API deploys automatically.

  2. An API key is not authentication: The x-api-key header is for client identification and usage tracking. Do not mistake it for a security mechanism. An API key alone does not provide authorization.

  3. The ACM certificate for an Edge-Optimized API must be in us-east-1: Since traffic to an Edge-Optimized endpoint flows through CloudFront, the custom domain's SSL/TLS certificate must be created in us-east-1 ACM. Regional/Private use the ACM of that region.

  4. WAF can be attached directly only to REST API: You cannot attach a WAF Web ACL directly to HTTP API. You must use the workaround of placing CloudFront in front and attaching WAF to CloudFront.

  5. The event structure of HTTP API Payload v2.0 is different: It has no httpMethod, resource, or path fields. Attaching an existing REST API Lambda as-is causes a KeyError. Set payloadFormatVersion: "1.0" or modify the code.

  6. You must specify the cache key for a Lambda Authorizer REQUEST type: If you don't specify a cache key, caching doesn't work and the Authorizer Lambda is invoked on every request.

  7. A Lambda Proxy response body must be a string: You must call json.dumps(); if you put a dict object directly, API Gateway can't serialize it.

  8. WebSocket $disconnect execution is not guaranteed: On a forced network termination, $disconnect may not run. You must automatically clean up stale connections with a DynamoDB TTL.

  9. WebSocket Idle Timeout 10 min, Max Duration 2 hours: Exceeding these limits forcibly terminates the connection. Clients can prevent the idle timeout with Ping/Pong.

  10. Cache invalidation (InvalidateCache) requires an IAM permission: If you enable requireAuthorizationForCacheControl on the stage, a client without the execute-api:InvalidateCache permission gets a 403 even when sending Cache-Control: max-age=0.

  11. CORS is handled by a different party depending on the integration type: In Lambda Proxy, Lambda must return the CORS headers directly. Under AWS_PROXY, API Gateway does not automatically add CORS headers. Using a Gateway Response, you can add CORS headers even to API Gateway's own errors (including 4XX).

  12. DynamoDB direct-integration VTL must handle the DynamoDB type system: DynamoDB responses are in {"S": "value"}, {"N": "123"} format. If you don't parse this into clean JSON in VTL, the client receives DynamoDB's internal format as-is.


DVA-C02 Domain Mapping

DomainRelated Week 4 topicsWeight
Domain 1: Development with AWS ServicesLambda Proxy integration, VTL, DynamoDB direct integration32%
Domain 2: SecuritySigV4, Lambda Authorizer, Cognito Authorizer, Resource Policy, WAF, mTLS26%
Domain 3: DeploymentStages, canary deployment, SAM integration, Stage Variables24%
Domain 4: TroubleshootingLatency vs IntegrationLatency, causes of 429/504/502 errors, Authorizer cache18%

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A startup provides an API to external partners. Partner A must be limited to 100,000 calls per month and Partner B to 500,000 per month. Also, Partner B needs a rate limit of 100 requests/second and Partner A 20 requests/second. What is the most appropriate configuration?

Question 2

A company's REST API Lambda function depends on an external payment service. In CloudWatch, 5XXError is increasing, Latency is close to 29 seconds, and IntegrationLatency is also close to 29 seconds. What is the most likely cause?

Question 3

A dev team implemented a DynamoDB direct integration (VTL) on a REST API. API Gateway calls DynamoDB GetItem and returns the response to the client. The client developer complained that the response comes in the format {"Item": {"name": {"S": "Hong Gildong"}, "age": {"N": "30"}}}. How do you fix this?

Question 4

A mobile app queries data through an API Gateway REST API. It authenticates with a Cognito User Pool. You want to reduce Lambda calls when the same user repeatedly queries the same data. You enabled response caching, but a problem arose where all users share the same cached value. What is the cause and solution?

Question 5

You're building a real-time stock trading alert system. When a trader connects from a web browser, the server must push price changes immediately. The trader has no need to send messages to the server. What is the most suitable architecture?

Question 6

A company wants to configure WAF on a REST API to block SQL injection. However, some legitimate requests are also being blocked. The team wants to analyze the pattern of blocked requests and fine-tune the WAF rules. Which WAF setting should they enable?

Question 7

A startup wants to deploy a Next.js backend API to AWS. Each API path is split into a separate Lambda, and the requirements are: (1) low cost, (2) Cognito-based JWT authentication, (3) automatic CORS setup, (4) a custom domain. Which API type is most suitable?

Question 8

There's an API using a Lambda Authorizer (TOKEN type, TTL 300 seconds). The security team requests that a specific user's JWT token be invalidated immediately. The token has not yet expired. What is the fastest way?

Question 9

In a WebSocket API-based real-time chat, you must broadcast a message only to users in a specific chat room. There's a connection registry in DynamoDB. What is the most efficient DynamoDB lookup method?

Question 10

A team uses API Gateway HTTP API with Lambda integration. The existing Lambda code was code that worked on REST API, reading the client IP with event["requestContext"]["identity"]["sourceIp"]. After switching to HTTP API, an error occurs in that code. What is the root cause and solution?

Week 4 Self-Assessment

Question typeIncluded questionsIf you need to relearn
Authentication method selection1, 8Day 18
Integration types & VTL3Day 17
Caching & throttling4, 1Day 18
Real-time communication design5, 9Day 19
API type selection7Day 16, 19
Troubleshooting (metrics)2Day 18
WAF & security6Day 18
Payload Format10Day 19
ScoreAssessment
9-10Complete understanding of API Gateway. Proceed to Week 5
7-8Excellent. Recheck the Day file for the questions you missed
5-6Good. Re-familiarize with the Week 4 Day 16-19 traps checklist
3-4Fair. Relearning all of Day 16-19 is recommended
0-2You need to relearn Week 4 from the beginning
PreviousWebSocket API and HTTP API: The Inner Workings of Real-Time Connections and Lightweight ProxiesWeek 4 · Day 4Next S3: The Philosophy of Object Storage and Designing Storage ClassesWeek 5 · Day 1

Official references

  • DVA-C02 official exam page(opens in a new tab)
  • AWS Lambda documentation(opens in a new tab)
  • Amazon API Gateway documentation(opens in a new tab)
  • Amazon DynamoDB documentation(opens in a new tab)
  • AWS WAF · Shield documentation(opens in a new tab)
  • Amazon Cognito documentation(opens in a new tab)

On this page

  • Full Week 4 Spec Reference
  • Complete Comparison of the Three API Gateway Types
  • Authentication Method Selection Mapping
  • Integration Type Selection Mapping
  • Key CloudWatch Metrics Summary
  • Week 4 Key Traps Checklist
  • DVA-C02 Domain Mapping
  • Scenario Practice Questions (10 questions)
  • Week 4 Self-Assessment