AWS Certified CloudOps Engineer - Associate (SOA-C03) free question 3 / 10 · Domain 2: Reliability and Business Continuity
Targets of an Application Load Balancer show the status unhealthy with the reason code Target.ResponseCodeMismatch. The health check path is /, and the application answers that path with a 301 redirect to a login page. The application works for users who follow the redirect. How should the engineer make the targets healthy?
- Change the health check protocol to TCP, so that the load balancer checks the connection to the target and ignores the status code
- Increase the health check timeout, so that the target has more time to answer the request with a 200 status code
- Raise the healthy threshold count, so that the load balancer needs more successful checks before it puts the target in service
- Add 301 to the success codes of the health check, for example 200-399, or point the health check path to a URL that returns 200
Show the answer and explanation
Answer: D
Why this is correct
The reason code Target.ResponseCodeMismatch means that the target answered the health check with a status code that is not in the success codes. The success codes (the Matcher setting) default to 200 and can be set to values from 200 to 499, either as a list or as a range. The redirect returns 301, so the engineer can add it to the success codes, for example with the range 200-399, or choose a health check path that returns 200.
Why the other options are wrong
"Change the health check protocol to TCP, so that the load balancer checks the connection to the target and ignores the status code" … For an Application Load Balancer the possible health check protocols are HTTP and HTTPS. A response code check is part of those protocols, and TCP is not offered.
"Increase the health check timeout, so that the target has more time to answer the request with a 200 status code" … A timeout is reported with the reason code Target.Timeout. The reason code in this case shows that the target answered with a status code that does not match the success codes.
"Raise the healthy threshold count, so that the load balancer needs more successful checks before it puts the target in service" … The threshold counts set how many consecutive results change the status of a target. The redirect gives a code that never matches the success codes, so more checks do not change the result.
Key points
Reason codes that begin with Target originate on the target side and codes that begin with Elb originate on the load balancer side. A target must register, be used by a listener rule, and pass the initial health checks before it can receive requests.