A team currently builds an artifact locally and uploads it to S3, runs a cache-clear command, downloads and unzips the artifact on each EC2 instance to deploy. The DevOps team wants a CI/CD process that can stop and roll back on failure and track deployment progress. Which combination of steps will achieve this? (Choose three.)
Choose an answer
Tap an option to check your answer.
Correct answer: Create a custom script that clears the local application cache and reference that script in the BeforeInstall lifecycle hook in the AppSpec file., Use AWS CodePipeline as the deployment pipeline and configure the repository as the pipeline’s source so developers check code into the repo., Use AWS CodeBuild to produce the build artifact and place it in S3, and use AWS CodeDeploy to deploy that artifact to the EC2 instances..
Why this is the answer
The correct options leverage AWS CodePipeline, CodeBuild, and CodeDeploy for a robust CI/CD process. CodePipeline orchestrates the entire workflow, providing visibility, stop-on-failure, and rollback capabilities. CodeBuild automates the artifact creation and stores it in S3, replacing the local build process. CodeDeploy handles the deployment to EC2 instances, offering lifecycle hooks like BeforeInstall to execute custom scripts, such as clearing the cache, before the new application version is installed. This ensures a clean deployment. Incorrect options: Using EventBridge and Lambda for artifact building on every merge is less suitable for complex builds compared to CodeBuild, which is designed for this purpose. Adding a user-data script to EC2 instances for cache clearing is not part of a controlled deployment process and doesn't integrate with deployment lifecycle hooks. Using AWS Systems Manager to retrieve and push artifacts is a manual or semi-automated approach that lacks the integrated pipeline features of CodeDeploy.
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