Based on the DVA-C02 exam guideReport an error
At the start of this week, "there are five Code* services" was probably a burden, but looking back after a week you can see that the five services are really five stages of one flow. CodeCommit receives the code, CodeBuild builds it, CodeDeploy deploys it, CodePipeline strings the whole thing together, and Elastic Beanstalk abstracts all of it at once. If you can draw this flow in your head without getting stuck, the CI/CD area of the DVA-C02 is effectively done.
This article is not a simple summary. We compare each service in depth once more, line up this week's easily confused pitfalls in a row, and check with 12 exam-style scenario questions. The final check is not "getting the answer right" but a self-grading of "can I explain why the other choices are wrong?"
Here is a one-line summary of what problem each of the five services was built to solve.
| Service | Problem it solves | Core abstraction |
|---|---|---|
| CodeCommit | "IAM-integrated Git hosting that satisfies enterprise compliance" | Repository = IAM resource |
| CodeBuild | "Done with a single buildspec, without managing build infrastructure yourself" | Build = ephemeral container |
| CodeDeploy | "Break the risky moment of deployment into small steps and verify" | Deployment = lifecycle hooks |
| CodePipeline | "A workflow engine that automatically connects multiple tools in order" | Pipeline = stage + action |
| Elastic Beanstalk | "A PaaS that automatically configures the entire infrastructure when you just hand over code" | Environment = CloudFormation stack |
💡 Related theory: The separation of these five services is a system-level application of the "Single Responsibility Principle." Instead of building a monolith where one service does everything, each service has just one responsibility and is designed to be connected through well-defined interfaces (IAM, S3 artifacts, EventBridge). That is why it is possible to use any one of them on its own (for example, using only CodeBuild, with Jenkins for the other CI and GitHub Actions for deployment). A choice saying "the Code* series must be used together" is wrong.
This collects every pair of easily confused concepts from this week's study. For a last check right before the exam.
| A | B | Key difference |
|---|---|---|
| CodeCommit | GitHub | IAM integration vs OAuth/PAT |
| CodeCommit Triggers | Notifications | SNS/Lambda vs AWS Chatbot (Slack/Chime) |
| buildspec.yml | appspec.yml | CodeBuild build definition vs CodeDeploy deployment definition |
| install | pre_build | Install runtimes/dependencies vs work right before the build (tests, authentication) |
| build | post_build | Main build vs post-build cleanup/push |
variables | parameter-store | Plaintext vs SSM SecureString (KMS) |
parameter-store | secrets-manager | Manual rotation vs automatic rotation |
| BUILD_GENERAL1_* | BUILD_LAMBDA_* | EC2 container vs Firecracker microVM |
| Cache LOCAL | Cache S3 | Limited to host reuse vs permanently shared |
| In-Place | Blue/Green | Replace files on the same instances vs a new environment |
| AllAtOnce | OneAtATime | Fast/risky vs slow/safe |
| Canary | Linear | Hold at 10% then jump to 100% vs even increments |
| ApplicationStop | ApplicationStart | Script from the previous revision vs script from the current revision |
| ValidateService | AfterAllowTraffic | In-Place validation vs validation after Blue/Green traffic shift |
| EC2 CodeDeploy | ECS CodeDeploy | In-Place or B/G vs Blue/Green only |
| ECS rolling | ECS CodeDeploy B/G | The ECS service itself vs using CodeDeploy |
| Pipeline V1 | V2 | Simple stage/action vs variables + filters + execution modes |
| Pipeline SUPERSEDED | QUEUED | A new execution cancels the old one vs in order |
| Action runOrder same | Different | Parallel vs sequential |
| Source category | Invoke category | Fetch code vs run an arbitrary function |
| Manual Approval | Lambda Invoke validation | A human decision vs automated validation |
| Beanstalk Rolling | Immutable | Sequential in the same ASG vs a whole new ASG |
| Beanstalk Web | Worker | ALB + HTTP vs SQS Daemon + background |
| .ebextensions | .platform | AL1 traditional vs AL2/AL2023 recommended |
| Beanstalk Blue/Green | Traffic Splitting | Manual URL swap vs automatic ALB weighted |
These are the subtle pitfalls you must distinguish on the exam. Each one could be a standalone question.
variables are plaintext - use parameter-store (SecureString) or secrets-manager for secrets.CODEBUILD_BUILD_SUCCEEDING variable.#{BuildVariables.X} in CodePipeline.The CodeBuild BUILD_LAMBDA compute type (released in late 2023) internally brings up the build container on top of a Firecracker microVM. Firecracker is a KVM-based microVM monitor that AWS open-sourced in 2018, boasting boot within 100ms and a 5MB memory footprint. It is the isolation technology that Lambda and Fargate use internally, designed to aim "between an ultra-light VM and a container."
🔍 Going deeper: What differs between Firecracker and an ordinary Docker container is isolation at the hardware virtualization (KVM) level. Docker isolates with Linux namespaces + cgroups, so it shares the kernel, but with Firecracker each VM has its own kernel. So in multi-tenant environments (running multiple customers' code on the same host), the security boundary is much stronger. This is the secret of how Lambda was safe from the start while running other customers' function code on the same host.
The hot partition problem appears on the exam in the pattern where CodeBuild stores results in DynamoDB, or in the common Lambda + DynamoDB combination. DynamoDB distributes data by the hash of the partition key, and if all writes pile onto a single partition key, only that partition is throttled. The fixes are ① write sharding (add a suffix) ② enable Adaptive Capacity (default) ③ rethink the partition key design.
When you set up IAM authentication on API Gateway, the client must sign every request with SigV4. When calling API Gateway from CodeBuild, SigV4 signing can happen automatically (handled by boto3/aws-sdk). There is a "Lambda → IAM authentication when calling API Gateway" scenario.
The SQS Daemon in a Beanstalk Worker environment exposes SQS's at-least-once delivery directly to the application. That is, the same message can be processed twice, and the application must guarantee idempotency. The standard pattern is to record the message ID or deduplication ID in DynamoDB to prevent duplicate processing.
If you add X-Ray instrumentation to an application being built, traces are collected in production, and sampling every request makes cost balloon. X-Ray's default sampling rule is "the first 1 request per second + 5% additional sampling." When "reduce X-Ray cost" appears on the exam, adjusting the sampling rule is the answer.
Drawing a production-grade CI/CD in which all of this week's services work together at once looks like this.
[Developer] git push origin feature/new-api
│
▼
[CodeCommit (or GitHub via Code Connection)]
│
│ EventBridge triggers immediately
▼
[CodePipeline V2 "myapp-pipeline"]
│
├── Stage 1: Source
│ Action: CodeCommit Source (output: SourceOutput)
│
├── Stage 2: Validate (parallel execution, runOrder=1)
│ Action A: CodeBuild "lint" (input: SourceOutput)
│ Action B: CodeBuild "security-scan" (Snyk, Bandit)
│ Action C: CodeBuild "unit-test" (output: TestReport)
│
├── Stage 3: Build
│ Action: CodeBuild "build"
│ - install: nodejs 20, docker
│ - pre_build: ECR login, IMAGE_TAG export
│ - build: docker build & push to ECR
│ - post_build: imagedefinitions.json
│ (output: BuildOutput with imagedefinitions.json)
│
├── Stage 4: Deploy-Staging
│ Action: ECS CodeDeploy Blue/Green
│ - Deploy Green tasks with the new task definition
│ - Smoke test via the ALB Test Listener
│ - Production Listener swap
│ - Terminate Blue tasks after 5 minutes
│
├── Stage 5: Integration Test
│ Action: CodeBuild "integration-test"
│ - Postman/Pytest against the staging endpoint
│
├── Stage 6: Manual Approval
│ Action: Manual Approval
│ - SNS notification → Slack via Chatbot
│ - 7-day timeout
│
└── Stage 7: Deploy-Production
Action: ECS CodeDeploy Blue/Green
- Lambda hook BeforeAllowTraffic: contract test
- 10% canary for 10 minutes → 100% (LambdaCanary10Percent10Minutes pattern)
- Automatic rollback when a CloudWatch Alarm is breached
| AWS | GCP | Azure |
|---|---|---|
| CodeCommit | Cloud Source Repositories | Azure Repos |
| CodeBuild | Cloud Build | Azure Pipelines (Build) |
| CodeDeploy | (none, Cloud Deploy launching) | Azure Pipelines (Release) |
| CodePipeline | Cloud Build triggers + Cloud Deploy | Azure Pipelines |
| Elastic Beanstalk | App Engine / Cloud Run | Azure App Service |
| CodeArtifact | Artifact Registry | Azure Artifacts |
The heart of CI/CD is a single promise: "the release procedure that people used to do manually every time, once defined, flows automatically from then on." The concrete implementation of that promise is this week's 5 services, and each service does just one role well in its own place.
Check points right before the DVA-C02 exam: ① the one-line role mapping of the 5 services ② the trade-offs of each CodeDeploy deployment strategy ③ the 9 predefined Lambda deployment configurations ④ the 6 Beanstalk deployment strategies ⑤ the new CodePipeline V2 features. You should be able to explain these 5 in your own words within 30 seconds.
Next week we look at data security, IAM, KMS, and Secrets Manager - the security area that is another core axis of the DVA-C02.
Click a choice to reveal the answer and explanation.
Question 1
A fintech company wants to run ① a security scan (Snyk) ② unit tests ③ lint in parallel for every code change, and requires all three to pass before moving to the next step. Which CodePipeline configuration is correct?
Question 2
An e-commerce company wants to deploy a Lambda-based payment processing function. Because a bad new version leads directly to payment failures, it must receive only 10% of traffic for the first 10 minutes and then, after automated validation, move gradually to 100%. Also, if the CloudWatch Alarm ErrorRate > 1% fires, it must roll back automatically. What is the most suitable configuration?
Question 3
You want to deploy an ECS Fargate-based microservice with CodeDeploy Blue/Green. Which of the following is NOT a required prerequisite?
Question 4
CodeBuild must connect to an Aurora cluster in a private subnet to run a DB migration. The current build runs in the default environment (an AWS managed VPC) and cannot reach Aurora. What is the most suitable fix?
Question 5
You are deploying a new version to a Beanstalk environment and need zero downtime with the fastest possible rollback, production instance capacity must never decrease, and a temporary doubling of cost is acceptable. What is the most suitable deployment strategy?
Question 6
Select 4 answersA SaaS company runs CodePipeline in the Source account and wants to deploy to an ECS service in the Prod account. Which of the following configurations are needed? Select all that apply.
Question 7
You noticed that SQS messages are intermittently processed twice in a Beanstalk Worker environment. What are the cause and the fix?
Question 8
Whenever a CodePipeline pipeline fails a production deployment, you want to automatically create an incident ticket in JIRA. What is the most suitable configuration?
Question 9
You want to **pass an IMAGE_TAG value determined dynamically during the build in CodeBuild to the CodeDeploy action in the next stage**. What is the suitable mechanism?
Question 10
A CloudWatch Alarm ErrorRate > 5% fired on a fleet (100 instances) undergoing an In-Place deployment to EC2 with CodeDeploy. Which combination of settings is needed for automatic rollback to work?
Question 11
A company uses an external RDS as the production DB for a Beanstalk environment. It injects the DB endpoint and password through environment variables, and wants to rotate the password automatically every 30 days while having the application automatically receive the new password. What is the most suitable configuration?
Question 12
You want to visualize the unit test results (JUnit XML) of a Java application being built with CodeBuild in the CodeBuild console. What buildspec.yml setting is needed?