Exam DOP-C02 Topic 1 Question 267 Discussion

Actual exam question for Amazon's DOP-C02 exam
Question #: 267
Topic #: 1
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? (Select TWO.)

Suggested Answer: A,C Vote an answer

To implement a more reliable deployment solution, a DevOps engineer should take the following actions:
Create a pipeline in AWS CodePipeline that uses the CodeCommit repository as a source provider. Configure pipeline stages that run the CodeBuild project in parallel to build and test the application. In the pipeline, pass the CodeBuild project output artifact to an AWS CodeDeploy action. This action will improve the deployment reliability by automating the entire process from code commit to deployment, reducing human errors and inconsistencies. By running the build and test stages in parallel, the pipeline can also speed up the delivery time and provide faster feedback. By using CodeDeploy as the deployment action, the pipeline can leverage the features of CodeDeploy, such as traffic shifting, health checks, rollback, and deployment configuration123 Create an AWS CodeDeploy application and a deployment group to deploy the packaged code to the EC2 instances. Configure the ALB for the deployment group. This action will improve the deployment reliability by using CodeDeploy to orchestrate the deployment across multiple EC2 instances behind an ALB. CodeDeploy can perform blue/green deployments or in-place deployments with traffic shifting, which can minimize downtime and reduce risks. CodeDeploy can also monitor the health of the instances during and after the deployment, and automatically roll back if any issues are detected. By configuring the ALB for the deployment group, CodeDeploy can register and deregister instances from the load balancer as needed, ensuring that only healthy instances receive traffic45 The other options are not correct because they do not improve the deployment reliability or follow best practices. Creating separate pipeline stages that run a CodeBuild project to build and then test the application is not a good option because it will increase the pipeline execution time and delay the feedback loop. Creating individual Lambda functions that use CodeDeploy instead of Systems Manager to run build, test, and deploy actions is not a valid option because it will add unnecessary complexity and cost to the solution. Lambda functions are not designed for long-running tasks such as building or deploying applications. Creating an Amazon S3 bucket and modifying the CodeBuild project to store the packages in the S3 bucket instead of in CodeArtifact is not a necessary option because it will not affect the deployment reliability. CodeArtifact is a secure, scalable, and cost-effective package management service that can store and share software packages for application development67
:
1: What is AWS CodePipeline? - AWS CodePipeline
2: Create a pipeline in AWS CodePipeline - AWS CodePipeline
3: Deploy an application with AWS CodeDeploy - AWS CodePipeline
4: What is AWS CodeDeploy? - AWS CodeDeploy
5: Configure an Application Load Balancer for your blue/green deployments - AWS CodeDeploy
6: What is AWS Lambda? - AWS Lambda
7: What is AWS CodeArtifact? - AWS CodeArtifact

by Tariq.Petrin at Mar 12, 2026, 12:08 PM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
Tariq.Petrin
2026-03-12 12:08:32
Selected Answer: BC
Everything is wrong in this site! Don't trust the anwers!
Why B + C is Correct
B — CodePipeline with SEPARATE stages for build then test, feeding CodeDeploy
✅ Separate sequential stages means: build must succeed before test runs, test must succeed before deploy runs. If tests fail, the pipeline stops. This directly fixes the "defects" problem.
✅ CodePipeline gives you a proper orchestrated, auditable, repeatable pipeline instead of Lambda manually invoking things.
✅ Passing the CodeBuild output artifact to CodeDeploy is the standard AWS-native pattern.
C — CodeDeploy application + deployment group configured with the ALB
✅ CodeDeploy with an ALB-integrated deployment group enables blue/green or rolling deployments that are ALB-aware — instances are deregistered from the ALB before deployment, code is deployed, health checks pass, then instances are re-registered. This directly fixes the "inconsistencies between instances" and "not running latest version" problems.
✅ CodeDeploy tracks every deployment, supports automatic rollback on failure, and guarantees all instances in the group reach the same state.
✅ The ALB integration ensures no traffic hits instances mid-deployment.

Why Each Wrong Option Fails
A — CodePipeline with build and test running IN PARALLEL
❌ Running build and test in parallel means they execute simultaneously. If tests fail, the build artifact may already be in progress or completed. Parallel stages don't enforce "test must pass before deploy" — that requires sequential stages. This directly contradicts the goal of catching defects before deployment. B is strictly better than A because of sequential vs parallel.
upvoted 2 times
...
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10