DOP-C02 Question 164
Single answerYour team is managing a CI/CD pipeline for a critical web application hosted on AWS. The application uses AWS Elastic Beanstalk for deployment, and recently, you’ve noticed that environment deployments frequently fail due to resource constraints in the underlying infrastructure. As a DevOps Engineer, how can you ensure that failed deployments automatically roll back to the last known good state to minimize downtime?
- A
Enable the 'Rolling with additional batch' deployment strategy in Elastic Beanstalk.
- B
Configure the Elastic Beanstalk environment to use Enhanced Health Reporting and enable the 'Automatic Rollback' feature.
- C
Modify the Elastic Beanstalk environment to use Immutable Deployment strategy.
- D
Use a custom script in the pipeline to detect failed deployments and trigger a rollback manually.
Show answer and explanation
Correct answer: B
Explanation
Elastic Beanstalk's 'Automatic Rollback' feature, when combined with Enhanced Health Reporting, enables the platform to monitor deployments and roll back to the last known good state in case of a failure. This approach provides a reliable and automated method to handle deployment issues with minimal downtime, making it the most suitable solution in this scenario.
- A. Incorrect.
The 'Rolling with additional batch' deployment strategy is a valid deployment method in Elastic Beanstalk but does not automatically handle rollbacks in case of deployment failures.
- B. Correct.
Configuring Enhanced Health Reporting and enabling 'Automatic Rollback' ensures that Elastic Beanstalk can detect a failed deployment and automatically revert to the last known working version, minimizing downtime.
- C. Incorrect.
The Immutable Deployment strategy creates a new environment for the deployment, which can improve reliability, but it does not directly address automatic rollbacks for failed deployments.
- D. Incorrect.
Using a custom script is an option, but it requires additional effort and is not as seamless or reliable as the built-in 'Automatic Rollback' feature provided by Elastic Beanstalk.