nerdexam
Amazon

DOP-C02 · Question #181

A company deploys a web application on Amazon EC2 instances that are behind an Application Load Balancer (ALB). The company stores the application code in an AWS CodeCommit repository. When code is me

The correct answer is B. Create a pipeline in AWS CodePipeline that uses the CodeCommit repository as a source C. Create an AWS CodeDeploy application and a deployment group to deploy the packaged code to. To achieve a more reliable deployment, the DevOps engineer should implement an AWS CodePipeline to orchestrate the CI/CD process, using CodeCommit for source, CodeBuild for packaging (with artifacts stored in S3), and AWS CodeDeploy as the deploy stage to ensure consistent, versi

Submitted by akirajp· Mar 6, 2026SDLC Automation

Question

A company deploys a web application on Amazon EC2 instances that are behind an Application Load Balancer (ALB). The company stores the application code in an AWS CodeCommit repository. When code is merged to the main branch, an AWS Lambda function invokes an AWS CodeBuild project. The CodeBuild project packages the code, stores the packaged code in AWS CodeArtifact, and invokes AWS Systems Manager Run Command to deploy the packaged code to the EC2 instances. Previous deployments have resulted in defects, EC2 instances that are not running the latest version of the packaged code, and inconsistencies between instances. Which combination of actions should a DevOps engineer take to implement a more reliable deployment solution? (Choose two.)

Options

  • ACreate a pipeline in AWS CodePipeline that uses the CodeCommit repository as a source
  • BCreate a pipeline in AWS CodePipeline that uses the CodeCommit repository as a source
  • CCreate an AWS CodeDeploy application and a deployment group to deploy the packaged code to
  • DCreate individual Lambda functions that use AWS CodeDeploy instead of Systems Manager to
  • ECreate an Amazon S3 bucket. Modify the CodeBuild project to store the packages in the S3

How the community answered

(22 responses)
  • B
    86% (19)
  • D
    9% (2)
  • E
    5% (1)

Why each option

To achieve a more reliable deployment, the DevOps engineer should implement an AWS CodePipeline to orchestrate the CI/CD process, using CodeCommit for source, CodeBuild for packaging (with artifacts stored in S3), and AWS CodeDeploy as the deploy stage to ensure consistent, versioned deployments to EC2 instances.

ACreate a pipeline in AWS CodePipeline that uses the CodeCommit repository as a source

This option is very similar to B but omits the crucial detail of configuring CodeBuild to store application artifacts in an S3 bucket, which is a prerequisite for using CodeDeploy for EC2 deployments.

BCreate a pipeline in AWS CodePipeline that uses the CodeCommit repository as a sourceCorrect

An AWS CodePipeline provides robust orchestration for CI/CD, replacing fragmented manual invocations with a managed workflow. Integrating CodeBuild to produce application artifacts and storing them in an S3 bucket is a standard and necessary step for subsequent deployment by AWS CodeDeploy, ensuring proper versioning and artifact management.

CCreate an AWS CodeDeploy application and a deployment group to deploy the packaged code toCorrect

AWS CodeDeploy is specifically designed for reliable, consistent application deployments to EC2 instances. It ensures all instances run the correct version, manages deployment strategies (like blue/green), and facilitates automated rollbacks, directly addressing the observed issues of inconsistencies and outdated application versions, thereby improving deployment reliability.

DCreate individual Lambda functions that use AWS CodeDeploy instead of Systems Manager to

Creating individual Lambda functions to invoke CodeDeploy would result in a custom and potentially unmanaged orchestration layer, which is less robust and scalable than using AWS CodePipeline for the entire CI/CD workflow.

ECreate an Amazon S3 bucket. Modify the CodeBuild project to store the packages in the S3

While creating an S3 bucket for package storage is correct, AWS CodeArtifact is a package management service, not a deployment service for pushing application code directly to EC2 instances; AWS CodeDeploy is needed for that purpose.

Concept tested: AWS CodePipeline orchestration and CodeDeploy for reliable EC2 deployments

Source: https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html

Topics

#AWS CodePipeline#AWS CodeDeploy#CI/CD#Application deployment

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice