
Answer-first summary for fast verification
Answer: Replace the NLB with an Application Load Balancer. Enable HTTP health checks by supplying the URL of the company's application. Configure an Auto Scaling action to replace unhealthy instances.
## Explanation **Correct Answer: C** **Why Option C is correct:** 1. **NLB vs ALB Health Checks**: Network Load Balancers (NLB) operate at Layer 4 (TCP/UDP) and perform basic TCP health checks. They cannot perform HTTP/HTTPS health checks at Layer 7. Application Load Balancers (ALB) operate at Layer 7 and can perform HTTP/HTTPS health checks with specific URLs. 2. **HTTP Error Detection**: The company needs to detect HTTP errors, which requires Layer 7 health checks. An ALB can check specific HTTP endpoints and response codes. 3. **Auto Scaling Integration**: ALB health checks integrate with Auto Scaling groups. When ALB marks an instance as unhealthy, Auto Scaling can automatically replace it. 4. **No Custom Code**: The solution doesn't require writing custom scripts or code. **Why other options are incorrect:** **Option A**: NLB cannot perform HTTP health checks. NLB only supports TCP, TLS, UDP, and TCP_UDP health checks, not HTTP/HTTPS. **Option B**: This requires writing custom scripts (cron job) and application-level monitoring, which violates the requirement of "without writing custom scripts or code." **Option D**: While CloudWatch alarms can monitor NLB metrics, the UnhealthyHostCount metric relies on NLB's health check status. Since NLB cannot perform HTTP health checks, it won't detect HTTP errors. Additionally, this approach adds complexity compared to the integrated ALB + Auto Scaling solution. **Key AWS Concepts:** - **NLB (Network Load Balancer)**: Layer 4 load balancer, supports TCP/UDP/TLS health checks - **ALB (Application Load Balancer)**: Layer 7 load balancer, supports HTTP/HTTPS health checks with specific paths and response codes - **Auto Scaling Health Checks**: Can use ELB health checks to determine instance health and automatically replace unhealthy instances **Best Practice**: For HTTP/HTTPS applications that require application-level health monitoring, use ALB instead of NLB to leverage HTTP health checks and seamless integration with Auto Scaling.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company's HTTP application is behind a Network Load Balancer (NLB). The NLB's target group is configured to use an Amazon EC2 Auto Scaling group with multiple EC2 instances that run the web service.
The company notices that the NLB is not detecting HTTP errors for the application. These errors require a manual restart of the EC2 instances that run the web service. The company needs to improve the application's availability without writing custom scripts or code.
What should a solutions architect do to meet these requirements?
A
Enable HTTP health checks on the NLB, supplying the URL of the company's application.
B
Add a cron job to the EC2 instances to check the local application's logs once each minute. If HTTP errors are detected, the application will restart.
C
Replace the NLB with an Application Load Balancer. Enable HTTP health checks by supplying the URL of the company's application. Configure an Auto Scaling action to replace unhealthy instances.
D
Create an Amazon CloudWatch alarm that monitors the UnhealthyHostCount metric for the NLB. Configure an Auto Scaling action to replace unhealthy instances when the alarm is in the ALARM state.