Automatic Instance Replacement Using ALB Health Checks
A company runs a web application on EC2 instances behind an ALB. To improve resilience, they want to automatically re-register failed instances. Which solution meets this requirement?
Quick Answer
The answer is to enable EC2 instance recovery and configure ALB health checks to deregister unhealthy instances. This solution works because the ALB health check detects a failed instance, automatically deregisters it from the target group, and then EC2 instance recovery replaces the instance on the same underlying host, which triggers re-registration with the ALB. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding of how ALB health checks integrate with EC2 recovery actions to achieve automatic instance replacement without requiring Auto Scaling or manual intervention. A common trap is assuming Auto Scaling is needed, but instance recovery handles the replacement directly at the hypervisor level, while the ALB health check manages the traffic flow. Remember the key pairing: ALB health checks handle deregistration, and EC2 recovery handles replacement and re-registration—think of it as “check and replace” for seamless resilience.
⚠ Common exam trap
It's easy for candidates to confuse EC2 instance recovery (which restarts the instance on a new host) with Auto Scaling's ability to replace instances, but the question specifically asks for re-registering the failed instance, not launching a new one.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable EC2 instance recovery and configure ALB health checks to deregister unhealthy instances.
Enabling EC2 instance recovery automatically restarts the instance on a new healthy host if the underlying hardware fails, while ALB health checks detect application-level failures and deregister unhealthy instances from the target group. This combination ensures failed instances are automatically replaced in the load balancer's rotation without manual intervention, meeting the resilience requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set up a CloudWatch alarm to terminate the instance and notify an operator to re-register it.
Why it's wrong here
CloudWatch alarms do not automatically re-register instances with ALB.
- ✓
Enable EC2 instance recovery and configure ALB health checks to deregister unhealthy instances.
Why this is correct
EC2 instance recovery replaces the instance and ALB health checks will automatically re-register it once healthy.
- ✗
Configure Auto Scaling to launch a new instance on instance failure.
Why it's wrong here
Auto Scaling can replace instances but does not automatically re-register them with the ALB without a health check integration.
- ✗
Use Route 53 health checks to detect failure and update DNS to remove the instance.
Why it's wrong here
Route 53 health checks affect DNS resolution, not ALB target group registration.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 251-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on DOP-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company runs a web application on EC2 instances behind an ALB. To improve resilience, they want to automatically replace failed instances and maintain a minimum number of instances. Which AWS service should be used?
easy- ✓ A.Amazon EC2 Auto Scaling
- B.AWS CloudFormation
- C.AWS Elastic Beanstalk
- D.AWS Systems Manager
Why A: Auto Scaling is designed to automatically replace failed instances and maintain a desired capacity, improving resilience.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.