An application is deployed to EC2 instances behind an ALB. The application code is in CodeCommit. When code is merged to main, a Lambda function triggers a CodeBuild project that packages the code, stores artifacts in CodeArtifact, and uses Systems Manager Run Command to deploy the package to EC2. Past deployments produced defects, inconsistent versions across instances, and instances not running the latest code. Which actions will create a more reliable deployment process? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Create a CodePipeline pipeline using the CodeCommit repository as the source. Add sequential pipeline stages that run CodeBuild to build, then run tests, and pass the CodeBuild output artifact to a CodeDeploy action., Create an AWS CodeDeploy application and a deployment group to deploy the packaged artifact to the EC2 instances, and configure the ALB for the deployment group..
Why this is the answer
The existing process has several issues, including defects, inconsistent versions, and instances not running the latest code, indicating a lack of automation, testing, and proper deployment orchestration. Creating a CodePipeline pipeline with sequential stages for build and test, followed by a CodeDeploy action, addresses these problems. CodePipeline provides end-to-end automation, ensuring every change goes through defined stages. Sequential stages ensure that testing occurs after building and before deployment, catching defects earlier. Creating an AWS CodeDeploy application and deployment group, configured with the ALB, is crucial. CodeDeploy ensures consistent deployments across all instances, handles rollbacks, and integrates with ALBs for blue/green or in-place deployments, minimizing downtime and ensuring all instances receive the latest code reliably. The incorrect options either don't fully solve the problem or introduce unnecessary complexity. Running CodeBuild in parallel for builds and tests is illogical; tests depend on a completed build. Replacing the flow with individual Lambda functions using CodeDeploy is overly complex and doesn't provide the orchestration benefits of CodePipeline. Storing artifacts in S3 instead of CodeArtifact is a lateral move and doesn't address the core deployment reliability issues.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed