Courseiva
DeploymenthardMultiple SelectObjective-mapped

DVA-C02 Deployment Practice Question

A company uses AWS CloudFormation to manage infrastructure. The development team wants to implement a CI/CD pipeline that automatically updates a CloudFormation stack when code is pushed to a CodeCommit repository. The pipeline should also run tests before deploying. Which THREE services should be used together to achieve this? (Choose THREE.)

⚠ Common exam trap

Many candidates confuse AWS CodeDeploy with CloudFormation stack updates, but CodeDeploy handles application-level deployments (e.g., code to instances) while CloudFormation manages infrastructure provisioning and updates, so CodeDeploy is not used for stack updates in this context.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

AWS CodeBuild

AWS CodeBuild is correct because it can compile source code, run tests, and produce artifacts that are ready for deployment. In this CI/CD pipeline, CodeBuild executes the test suite after code is pushed to CodeCommit, ensuring that only validated code proceeds to update the CloudFormation stack.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • AWS CodeBuild

    Why this is correct

    In a CloudFormation CI/CD pipeline, AWS CodeBuild is crucial for validating templates using tools like `cfn-lint`, running unit tests on custom resources or Lambda functions, and packaging deployment artifacts. It can also be used to transform CloudFormation templates, for instance, by using `sam build` for SAM templates, before they are deployed. CodeBuild's compute environment executes commands defined in a `buildspec.yml` file, making it the workhorse for all pre-deployment processing and quality checks within the pipeline.

  • Amazon CloudWatch Events

    Why it's wrong here

    While Amazon CloudWatch Events (now Amazon EventBridge) can indeed trigger AWS CodePipeline executions based on various AWS service events or schedules, it is not a core component *within* the pipeline stages for managing CloudFormation infrastructure. CodePipeline natively integrates with AWS CodeCommit to detect changes and initiate pipeline runs automatically. Therefore, CloudWatch Events serves as an external trigger mechanism rather than an internal pipeline stage responsible for building or deploying infrastructure.

  • AWS CodeDeploy

    Why it's wrong here

    AWS CodeDeploy is specifically designed for automating application deployments to various compute services such as Amazon EC2 instances, AWS Lambda functions, and Amazon ECS containers. It manages the deployment lifecycle, including rolling updates, rollbacks, and traffic shifting strategies for application code. However, for managing AWS CloudFormation stack updates, AWS CodePipeline directly interacts with the CloudFormation service API actions (e.g., `CreateChangeSet`, `ExecuteChangeSet`) in its deploy stage, rather than using CodeDeploy as an intermediary for infrastructure changes.

  • AWS CodePipeline

    Why this is correct

    AWS CodePipeline serves as the orchestration engine for the entire continuous delivery process, defining and automating the workflow from source code commit to deployment. It integrates various AWS services like AWS CodeCommit, AWS CodeBuild, and AWS CloudFormation into distinct stages such as Source, Build, Test, and Deploy. For CloudFormation infrastructure, CodePipeline manages the flow, ensuring that infrastructure-as-code changes are built, validated, and then applied to AWS environments in a controlled and automated manner.

  • AWS CodeCommit

    Why this is correct

    AWS CodeCommit acts as the secure, highly scalable, and fully managed source control service for storing and versioning the CloudFormation templates and any associated code, such as custom resource Lambda functions. It integrates seamlessly with AWS CodePipeline, automatically triggering pipeline executions whenever changes are pushed to the designated repository branch. This ensures that all infrastructure-as-code changes are tracked, versioned, and processed through the defined CI/CD workflow efficiently.

About these practice questions

One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.