A company hosts a web application on a fleet of Amazon EC2 instances behind an Application Load Balancer (ALB). The application listens on port 8080. The target group is configured to perform health checks using the HTTP protocol on port 8080 with the path `/status`. Following a security update, the application now requires an API key in the HTTP header for all requests under the `/status` path, returning an HTTP 401 Unauthorized response to requests without the key. As a result, the ALB target group marks all instances as unhealthy. Which action should a SysOps administrator take to resolve this issue?
- Configure a new, unauthenticated endpoint on the application, such as `/health`, that does not require an API key, and update the target group's health check path to `/health`.Cevap
- BUpdate the target group's health check settings to include 401 in the list of successful HTTP matcher codes.
- CModify the ALB listener rule to inject a custom HTTP header containing the valid API key for all incoming health check requests.
- DConfigure an Amazon Route 53 active-passive failover routing policy to route traffic directly to the EC2 instances' public IP addresses, bypassing the ALB health checks.
Cevap
Configure a new, unauthenticated endpoint on the application, such as `/health`, that does not require an API key, and update the target group's health check path to `/health`.
The correct action is to create a new, unauthenticated endpoint on the application (such as `/health`) that returns a 200 OK status code, and update the target group to use this path. Since Application Load Balancers generate anonymous health check requests without custom headers, any endpoint requiring API keys or basic authentication will fail the health check. A dedicated, unauthenticated health check endpoint allows the target group to verify instance health safely.
Adım Adım Çözüm
Anahtar Kavram
ELB Target Group Health Checks and Authentication