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
  • Week 5
  • Week 6
  • Week 7
  • Week 8
    • 1.CodeCommit and CodeBuild: The First Two Squares of CI/CD as Drawn by AWS
    • 2.CodeDeploy: Making the Riskiest Moment, Deployment, Safe
    • 3.CodePipeline: The Conductor of CI/CD Flow
    • 4.Elastic Beanstalk: AWS's Most Friendly PaaS
    • 5.Week 8 Comprehensive Review: Running the CI/CD Pipeline End to End in Your Head
  • 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 8/Day 5

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

DVA-C02· AssociateWeek 8 · Day 5~44 min read

Day 5 - Week 8 Comprehensive Review: Running the CI/CD Pipeline End to End in Your Head

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?"

The Essence of the 5 Services in One Line

Here is a one-line summary of what problem each of the five services was built to solve.

ServiceProblem it solvesCore 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.

25 Easily Confused Pairs

This collects every pair of easily confused concepts from this week's study. For a last check right before the exam.

ABKey difference
CodeCommitGitHubIAM integration vs OAuth/PAT
CodeCommit TriggersNotificationsSNS/Lambda vs AWS Chatbot (Slack/Chime)
buildspec.ymlappspec.ymlCodeBuild build definition vs CodeDeploy deployment definition
installpre_buildInstall runtimes/dependencies vs work right before the build (tests, authentication)
buildpost_buildMain build vs post-build cleanup/push
variablesparameter-storePlaintext vs SSM SecureString (KMS)
parameter-storesecrets-managerManual rotation vs automatic rotation
BUILD_GENERAL1_*BUILD_LAMBDA_*EC2 container vs Firecracker microVM
Cache LOCALCache S3Limited to host reuse vs permanently shared
In-PlaceBlue/GreenReplace files on the same instances vs a new environment
AllAtOnceOneAtATimeFast/risky vs slow/safe
CanaryLinearHold at 10% then jump to 100% vs even increments
ApplicationStopApplicationStartScript from the previous revision vs script from the current revision
ValidateServiceAfterAllowTrafficIn-Place validation vs validation after Blue/Green traffic shift
EC2 CodeDeployECS CodeDeployIn-Place or B/G vs Blue/Green only
ECS rollingECS CodeDeploy B/GThe ECS service itself vs using CodeDeploy
Pipeline V1V2Simple stage/action vs variables + filters + execution modes
Pipeline SUPERSEDEDQUEUEDA new execution cancels the old one vs in order
Action runOrder sameDifferentParallel vs sequential
Source categoryInvoke categoryFetch code vs run an arbitrary function
Manual ApprovalLambda Invoke validationA human decision vs automated validation
Beanstalk RollingImmutableSequential in the same ASG vs a whole new ASG
Beanstalk WebWorkerALB + HTTP vs SQS Daemon + background
.ebextensions.platformAL1 traditional vs AL2/AL2023 recommended
Beanstalk Blue/GreenTraffic SplittingManual URL swap vs automatic ALB weighted

20 Pitfalls of the Week

These are the subtle pitfalls you must distinguish on the exam. Each one could be a standalone question.

  1. CodeCommit has not accepted new sign-ups since July 2024 - but existing customers keep using it, and it is still tested on the exam.
  2. HTTPS Git Credentials are separate from the IAM console sign-in password - they must be issued separately.
  3. The Credential Helper generates a new password with SigV4 on every git operation - automatic authentication with the EC2 instance profile.
  4. CodeBuild uses a fresh container for every build - startup 10-30s, and the LOCAL cache works only when the host is reused.
  5. CodeBuild environment variables under variables are plaintext - use parameter-store (SecureString) or secrets-manager for secrets.
  6. privileged: true is required for Docker builds in CodeBuild - the DinD pattern.
  7. CodeBuild VPC mode adds +30s to startup because of ENI provisioning - internet outbound disappears, so various endpoints are needed.
  8. post_build in buildspec.yml runs even when build fails - branch on the CODEBUILD_BUILD_SUCCEEDING variable.
  9. exported-variables in buildspec.yml are passed to subsequent stages - #{BuildVariables.X} in CodePipeline.
  10. CodeDeploy EC2 deployments require the Agent - Lambda/ECS have no Agent.
  11. For ECS, only Blue/Green is possible with CodeDeploy - In-Place is the ECS service's own rolling.
  12. On EC2, ApplicationStop runs the script from the previous revision - the new script runs at the next deployment.
  13. An AllAtOnce deployment is a deployment success even if only 1 instance succeeds - service availability is a separate matter.
  14. The decisive difference between Lambda Canary and Linear is "100% in one step vs even increments."
  15. The Lambda BeforeAllowTraffic/AfterAllowTraffic hooks must call PutLifecycleEventHookExecutionStatus - otherwise a 1-hour timeout.
  16. CodePipeline V2 trigger filters support only CodeStar Source Connection - for CodeCommit, use an EventBridge rule.
  17. The CodePipeline artifact bucket must be in the same Region as the pipeline - for Cross-Region, a separate one in each Region.
  18. Manual Approval is automatically rejected if there is no response in 7 days.
  19. If you create RDS inside a Beanstalk environment, it is deleted along with the environment - keep production outside.
  20. A Beanstalk Worker has no ALB, and the SQS Daemon converts to HTTP - the application is a regular HTTP server.

DVA-C02-Specific Topics: 5 Depth Points

1. Lambda Firecracker and CodeBuild Lambda compute

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.

2. DynamoDB partitions and hot partitions (tested indirectly)

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.

3. API Gateway and SigV4

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.

4. SQS at-least-once and the Beanstalk Worker

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.

5. X-Ray sampling and CI/CD pipelines

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 the Whole CI/CD Flow at Once

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

Equivalent Services in Other Clouds

AWSGCPAzure
CodeCommitCloud Source RepositoriesAzure Repos
CodeBuildCloud BuildAzure Pipelines (Build)
CodeDeploy(none, Cloud Deploy launching)Azure Pipelines (Release)
CodePipelineCloud Build triggers + Cloud DeployAzure Pipelines
Elastic BeanstalkApp Engine / Cloud RunAzure App Service
CodeArtifactArtifact RegistryAzure Artifacts

Wrap-Up

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.

📝 Practice Questions

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 answers

A 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?

PreviousElastic Beanstalk: AWS's Most Friendly PaaSWeek 8 · Day 4Next KMS: Handling Encryption Keys Without Touching Them DirectlyWeek 9 · Day 1

Official references

  • DVA-C02 official exam page(opens in a new tab)
  • AWS Lambda documentation(opens in a new tab)
  • AWS CodeBuild documentation(opens in a new tab)
  • AWS CodeDeploy documentation(opens in a new tab)
  • Amazon ECS · Fargate documentation(opens in a new tab)
  • Amazon SQS documentation(opens in a new tab)

On this page

  • The Essence of the 5 Services in One Line
  • 25 Easily Confused Pairs
  • 20 Pitfalls of the Week
  • DVA-C02-Specific Topics: 5 Depth Points
  • 1. Lambda Firecracker and CodeBuild Lambda compute
  • 2. DynamoDB partitions and hot partitions (tested indirectly)
  • 3. API Gateway and SigV4
  • 4. SQS at-least-once and the Beanstalk Worker
  • 5. X-Ray sampling and CI/CD pipelines
  • Drawing the Whole CI/CD Flow at Once
  • Equivalent Services in Other Clouds
  • Wrap-Up
  • Comprehensive Scenario Practice Questions (12 questions)