Courseiva

DOP-C02 Configuration Management and IaC Practice Question

A company is using AWS Elastic Beanstalk with a custom platform. The DevOps team wants to automate the creation of a new platform version whenever changes are pushed to a Git repository. The pipeline should run tests, build the platform, and then update the Elastic Beanstalk environment to use the new platform version. Which services should be used together to achieve this? (Choose THREE.)

⚠ Common exam trap

Many candidates confuse AWS CodeDeploy with Elastic Beanstalk platform updates, but CodeDeploy cannot create or manage custom platform versions; only CodeBuild with Packer can build the platform artifact, and CodePipeline orchestrates the full CI/CD pipeline.

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 run the tests and build the custom platform artifact. In this scenario, CodeBuild executes the buildspec to compile code, run unit tests, and produce the platform version (e.g., an AMI or Packer image). It integrates directly with CodePipeline to receive source changes and pass artifacts downstream for environment updates.

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 CloudFormation

    Why it's wrong here

    AWS CloudFormation is an infrastructure-as-code service that declaratively provisions AWS resources; it cannot run the arbitrary bash scripts or Packer commands required to build a custom Elastic Beanstalk platform AMI. Even if you model the environment as a stack, CloudFormation would only create or update resources after an AMI already exists, leaving the actual image-building step outside its capability.

  • ✓

    AWS CodeBuild

    Why this is correct

    AWS CodeBuild is a fully managed build service that can execute a custom build spec in a disposable compute environment. To create a custom Elastic Beanstalk platform, CodeBuild can run the Packer templates and platform hooks that produce the platform's AMI, making it the correct AWS service for the build itself. Its ephemeral environment, clean snapshots, and retryable builds make it well suited for repeatable platform builds.

  • ✓

    AWS CodePipeline

    Why this is correct

    AWS CodePipeline is an orchestration-only service that models stages and transitions in a release workflow; it does not perform build or packaging operations itself. In a custom-Elastic Beanstalk platform workflow, CodePipeline can be the outer CI/CD layer that invokes CodeBuild as a build action (which runs Packer), then deploys the resulting AMI or platform version. Thus it plays a supporting role, giving visibility, triggers, and approvals around the build, but it depends on CodeBuild or another action provider to do the actual work.

  • ✓

    HashiCorp Packer (run in CodeBuild)

    Why this is correct

    HashiCorp Packer is the tool that actually creates the machine image for a custom Elastic Beanstalk platform; a Packer template specifies the source AMI, provisioners (such as shell scripts or Ansible), and virtual-builder configuration. When Packer runs inside CodeBuild, the two give an end-to-end, code-defined path from base Amazon Linux AMI to a ready-to-use platform AMI. This is why the combination is a correct answer: Packer is the image builder, and CodeBuild is the AWS service that executes it.

  • ✗

    AWS CodeDeploy

    Why it's wrong here

    AWS CodeDeploy is an application-deployment service that pushes your application code to running EC2 instances (or Lambda/ECS) and manages lifecycle hooks during a deployment. It has no concept of building a base machine image or platform AMI, and it cannot be used to package an Elastic Beanstalk platform. Custom platform creation happens before instances exist, so CodeDeploy, which operates on already-provisioned infrastructure, is not applicable here.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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 DOP-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 DOP-C02 exam.