Our goal is to have a Healthcheck continuously evaluate the health of an endpoint. When it becomes unhealthy, we want the DNS to failover to a different IP address. We have set this up but we now realized that it actually doesn't work (i.e. when the Healthcheck goes red, no failover happens). Here is our current configuration:
A Record
- Record name: www.mydomain.com
- Record type: A
- TTL: 30 seconds
- Routing policy: Failover
- Failover record type: Primary
- Healthcheck: www
- Record ID: www-1
- Value:
A Record
- Record name: www.mydomain.com
- Record type: A
- TTL: 30 seconds
- Routing policy: Failover
- Failover record type: Secondary
- Healthcheck: www
- Record ID: www-1
- Value:
In addition, we have a health check.
OK - so we recently had an issue, where the healthcheck turned red. We got notified via SNS as expected. However, when doing an NSLookup of www.mydomain.com it was still returning the value for the Primary. We fixed the issue within less than 5 minutes.
Given the TTL and so on configured above, shouldn't we have seen the NSLookup update to show the Secondary? Is it possible it would take longer to failover? If so, why?
Is there an error of some kind in the configuration above? If so any guidance would be greatly appreciated.
From the configuration shown in the question it looks like there is only one health check tied to both the primary and the secondary records?
In that case both the primary and secondary record will always be considered up/down at the same time, which undermines whole idea of selecting the best one which is up.
Create a health check for each endpoint and tie them to the corresponding records.