Based on the DOP-C02 exam guideReport an error
If we sum up this week in one sentence, it is: "CI/CD for serverless workloads has to be viewed as a single package, from choosing the IaC tool to the deployment strategy to workflow orchestration." SAM (Day 1), Serverless Framework and CDK (Day 2), Lambda Versions, Aliases, and CodeDeploy Canary (Day 3), and Step Functions (Day 4) are all different faces of the same picture. Scenario questions on the exam almost always combine two or three tools, so the ability to match precisely where each tool shines and where it is weak is what decides whether you pass.
Today we reorganize the five core axes of this week and run a comprehensive check with 12 scenario questions that resemble real exam patterns. The goal goes beyond memorizing plain facts: it is to memorize the mapping of "which keyword in this scenario calls which answer."
| Scenario keyword | Suitable tool | Reason |
|---|---|---|
| "Only Lambda + API Gateway + DynamoDB, YAML" | SAM | CFN Macro optimizes 6 serverless resource types, low learning curve |
| "200 Lambda functions, multi-stage, rich plugins" | Serverless Framework | Node plugin ecosystem (but review the v4 license) |
| "Lambda + EKS + RDS + OpenSearch + TS team" | CDK | L2 abstractions for all AWS resources + grant methods + in-house L3 libraries |
| "Multi-cloud (AWS+GCP+Azure)" | Terraform | Cloud-agnostic through the Provider model |
| "Keep CFN governance (StackSets, Drift) as is + simplify serverless" | SAM | Compatible with every CFN feature |
| "9,000 in-house stacks + need a standard pattern library" | CDK | Reusable abstractions through L3 Constructs |
Core proposition: a Version is an immutable snapshot, an Alias is a mutable pointer. Same idea as Git commit/branch, Docker image digest/tag.
publish-version → V7 (immutable, never changes)
update-alias --function-version 7 → live points to V7
| Feature | Behavior |
|---|---|
$LATEST | Mutable working copy, no weighted routing, no PC |
| Version number | Immutable; only resource policy and PC can be changed |
| Alias weighted | primary + 1 additional only (max 2-way) |
| API Gateway integration | ${stageVariables.alias} + add-permission --qualifier <alias> |
| CodeDeploy Canary | AutoPublishAlias + DeploymentPreference in one line |
| Technique | Applicable runtimes | Cost | Effect |
|---|---|---|---|
| Provisioned Concurrency | All runtimes | Billed for active time | Zero cold start (within PC capacity) |
| SnapStart | Java 11/17/21, Python 3.12+, .NET 8+ (zip only) | Free for Java, paid for Py/.NET | Init time reduced by 90% |
| Reserved Concurrency | All | Free | Concurrency limit (unrelated to cold start) |
| ARM architecture | Compatible runtimes | 20% cheaper | Init 10-20% faster |
| Item | Standard | Express |
|---|---|---|
| Duration | 1 year | 5 minutes |
| Guarantee | Exactly-once | At-least-once |
| Synchronous invocation | Not possible | Possible (StartSyncExecution) |
| TaskToken | ✅ | ❌ |
| Pricing | Per state transition | Per invocation + execution time |
| Use | Deployment workflows, human approval | API backends, IoT, ETL |
┌─ Source (Git) ──→ CodePipeline ──→ CodeBuild (sam build) ──→ CFN Deploy ──┐
│ ↓
│ Publish new Lambda Version V7
│ ↓
│ CodeDeploy: Alias 'live' weighted (V6:90, V7:10)
│ ↓
│ Wait 5 min + monitor CloudWatch Alarm
│ ↓
│ ┌─ Alarm OK → V7:100
│ └─ Alarm → V6:100 (rollback)
│
└─ Complex flows → delegate to Step Functions
├─ AWS SDK Service Integration (call directly without Lambda)
├─ TaskToken (human approval, external systems)
└─ Distributed Map (large-scale parallelism)
| A | B | Distinguishing keyword |
|---|---|---|
| SAM | CDK | YAML serverless-specialized vs general-purpose code, all of AWS |
| SAM | Serverless Framework | AWS-native, OSS vs multi-cloud, v4 commercial |
| Standard SFn | Express SFn | 1 year, exactly-once vs 5 minutes, at-least-once |
| Provisioned Concurrency | Reserved Concurrency | Warm-up, paid vs limit, free |
| Lambda zip | Container Image | 250MB, Layers possible vs 10GB, no Layers, no SnapStart |
$LATEST | Version number | Mutable, no PC vs immutable, PC possible |
| Alias weighted | Version 100% | Canary in two stages vs All-at-once |
| Inline Map | Distributed Map | 40 concurrent, affects parent history vs 10K concurrent, child executions |
.sync integration | .waitForTaskToken | Waits for automatic completion vs waits for external callback |
| sam deploy | sam sync | Standard CFN path vs development speed-up, drift risk |
Every comparison in this table is a classic trade-off model. System design principles such as the CAP theorem (Eric Brewer, 2000), PACELC (Daniel Abadi, 2010), and Conway's law (1968) apply equally to IaC and workflow tools. For example, Standard SFn's exactly-once is a consistency guarantee that gives up some availability/performance, while Express's at-least-once is the opposite trade. Exam scenarios almost always ask "which trade-off matters more."
🎯 Scenario: A question may appear on the exam that combines this week's five tools into the following picture: "Synthesize Lambda+DynamoDB+API Gateway with CDK → CodePipeline Source/Build → deploy with SAM Canary → 30 minutes of monitoring → sequential multi-Region deployment with human approval through Step Functions." Questions may ask which service is responsible at each step of this flow.
A case presented at AWS Summit Seoul in 2023 by a fintech company: it ran 1,500 Lambdas with a mix of CDK and SAM. Simple serverless (API + Lambda + Dynamo) used SAM, complex infrastructure (Lambda + EKS + OpenSearch + Step Functions) used CDK, and the deployment workflow was separated out into CodePipeline + Step Functions. By matching the strength of each tool precisely, deployment time dropped by 70%. On the exam, the answer to "how do you combine several tools?" is "separate them according to each tool's strengths" - trying to do everything with one tool is an anti-pattern.
⚠️ Pitfall 1: Forgetting
add-permission --qualifiercauses a 403 when API Gateway invokes an Alias. A Function ARN permission only allows$LATEST.
⚠️ Pitfall 2: With SnapStart, every invocation generates the same UUID/random value. You must reinitialize in the
afterRestorehook oforg.crac.Resource.
Pitfall 3: SAM Policy Templates are broad (including GSI/LSI). For PCI/HIPAA, write the
Statementdirectly to restrict to exact ARNs.
Pitfall 4:
sam sync --watchbypasses CFN, so drift occurs. In production, the next regular deploy overwrites the changes.
Pitfall 5: PC cannot be set on
$LATEST, only on an Alias/Version. During a Canary both Versions have PC, so cost temporarily doubles.
Pitfall 6: Container Image Lambda cannot use Layers or SnapStart. Include all dependencies in the Dockerfile.
Pitfall 7: Alias weighted routing supports only primary + 1 additional. For 3-way you need an ALB target group or Route 53 weighted records.
Pitfall 8: Step Functions Express does not support TaskToken. A human-approval workflow must use Standard.
Click a choice to reveal the answer and explanation.
Question 1
A SaaS team runs 200 Lambda functions with Serverless Framework v3, and the annual cost of the v4 commercial license is a burden. What is the most reasonable migration path?
Question 2
You want to bring the P99 latency of a Java Spring Boot Lambda (1GB memory, 80MB package, 8-second init) under 1 second, while also minimizing cost. What is the most effective combination?
Question 3
You must transform and aggregate 50 million JSON objects (average 50KB) in an S3 data lake every day. A 1% failure rate is tolerable, and operational burden must be minimal. What is the most suitable pattern?
Question 4
An API Gateway REST API points to the Lambda Alias live, but every code change triggers an API redeployment, making operations cumbersome. What is the cleanest configuration?
Question 5
A team passed all integration tests with sam local invoke and then deployed to production. Lambda was throttled immediately and API Gateway returned 5xx after a 30-second timeout. What is the most likely cause?
Question 6
You must include an ML model (2.5GB) in a Lambda zip package. It exceeds the zip limit. What is the most suitable packaging method?
Question 7
In a CodePipeline sequential deployment us-east-1 → eu-west-1 → ap-northeast-2, if an alarm fires at the EUW1 stage, USE1 and EUW1 must be rolled back in reverse order. What is the most suitable configuration?
Question 8
For a production deployment there is a 3-stage approval: security team → DevOps team → automatic deployment. If there is no response within 7 days at each stage it is automatically canceled, and notification is through a Slack interactive message. What is the most suitable workflow engine and pattern?
Question 9
A team is using sam sync --watch in the production environment. A few days later the next regular sam deploy overwrote all the hotswap changes. What is the most accurate explanation of the cause?
Question 10
A company manages 1,500 Lambda functions with CDK. Each team keeps writing similar function patterns (Lambda + DynamoDB + API Gateway + IAM grant + X-Ray + Powertools) over and over. How do you ensure operational standardization and reusability?
Question 11
A team runs production with CDK Pipelines and selfMutation: true enabled. One day they pushed a wrong pipeline definition and deployed a pipeline that broke self-mutation. The next execution started with the broken pipeline and cannot recover normally. What is the most appropriate prevention and recovery strategy?
Question 12
A payment company designs its payment-processing workflow as follows: validation (50ms) → authentication (100ms) → charge (150ms) → recording (50ms). A synchronous response through API Gateway is required, at 500 calls per second. What is the most suitable workflow engine and invocation pattern?
Finally, let's recap the core of the five axes you learned this week.
IaC tool choice is decided by workload nature and team language. SAM for AWS-only serverless, CDK for diverse AWS resources, Terraform for multi-cloud. For Serverless Framework, reviewing the v4 license is mandatory.
A Lambda Version is an immutable snapshot, an Alias is a mutable pointer. Same idea as Git commit/branch. Weighted routing is possible only with primary + 1 additional - the structural reason CodeDeploy Canary works "one step at a time."
The two standards of cold start mitigation - Provisioned Concurrency (warm-up, paid) vs SnapStart (Java/Python/.NET zip only, init time reduced by 90%). Reserved Concurrency is a limit setting and unrelated to cold start.
Step Functions: choose Standard/Express by invocation frequency x execution time. AWS SDK Service Integration calls 200+ services without Lambda. TaskToken integrates humans and external systems. Distributed Map runs 10K concurrent child workflows.
The integrated flow is the combination of CodePipeline + CodeBuild + CFN/SAM Deploy + CodeDeploy Canary + Step Functions. Separating them according to each service's strengths is the standard pattern. Trying to do everything with one tool is an anti-pattern.
Advanced IaC - Going Deep on CloudFormation/CDK/Terraform
If this week's theme was "which tool to use," next week's is "how to operate that tool in depth." Applying policies to 100 accounts at once with StackSets, catching manual changes with Drift Detection, and integrating resources CFN doesn't know about with Custom Resources - the real territory of enterprise IaC unfolds.