DOP-C02 Question 317
Single answerYour organization is running a fleet of EC2 instances behind an Application Load Balancer (ALB) to handle web traffic. You notice that some instances occasionally become unresponsive due to application issues. To ensure high availability and minimize manual intervention, you want to automate the replacement of unhealthy instances in the fleet. Which solution would best address this requirement?
- A
Use AWS Auto Scaling with an attached health check that monitors instance status and replaces unhealthy instances automatically.
- B
Use AWS Systems Manager Run Command to manually terminate the unresponsive instances and then relaunch them.
- C
Configure an Amazon CloudWatch Alarm to trigger an SNS notification when an instance becomes unhealthy, and manually replace the instance.
- D
Enable EC2 Auto Recovery to reboot the unresponsive instances when a system status check fails.
Show answer and explanation
Correct answer: A
Explanation
AWS Auto Scaling is the most suitable solution for this scenario as it allows for the automatic replacement of unhealthy instances in the fleet, leveraging health checks from the Application Load Balancer (ALB) or EC2 instance status checks. This ensures high availability and eliminates the need for manual intervention when instances become unresponsive. Other options either require manual effort or are limited in addressing the specific requirements of the scenario.
- A. Correct.
This is the correct answer. AWS Auto Scaling can automatically replace unhealthy instances based on health checks (either EC2 instance status checks or ALB target group health checks), ensuring high availability and reducing manual intervention.
- B. Incorrect.
This is not the best solution because it requires manual intervention to terminate and relaunch instances, which doesn't align with the requirement to minimize manual work.
- C. Incorrect.
While CloudWatch can detect unhealthy instances and trigger notifications, this approach still requires manual intervention to replace the instances, which is less efficient than using Auto Scaling.
- D. Incorrect.
EC2 Auto Recovery is useful for rebooting instances when system status checks fail, but it does not address application-level issues or replace instances that fail ALB health checks.