Route 53 health checks monitor the health and performance of your web resources. Health checks can monitor a specific resource (such as a web server or load balancer) or the status of an Amazon CloudWatch alarm. You can configure DNS failover based on the status of a health check. This is a great way to configure availability across regions or between an on-premises datacenter and AWS. You can configure a CloudWatch alarm for each health check if you want to be alerted about failures.
Figure 12.7 shows multiple resources that perform the same function. In this case, they are interchangeable web servers in different regions. The active web server instance has failed, and Route 53 will now resolve all future requests to the healthy resource. This is a simple active/standby failover model; however you can also combine failover routing with other routing policies (weighted, latency-based) to spread the workload across multiple resources during normal operation.
FIGURE 12.7 Failover routing policy
Geolocation routing lets you choose the resource record that will be returned based on the geographic location where DNS queries originate from. For example, you might want all requests that originate in the United States to resolve to a version of your website in the English language. Different geographic areas may resolve to different resources that provide your website in other languages. Geolocation routing does not consider latency. Geographic locations can include continents, by country, or by state in the United States. If Route 53 receives a DNS query and cannot identify the location, it provides a default record that you configure.
Weighted routing is ideal for a blue/green deployment. The blue environment represents the established, reliable configuration. DNS can be used to switch traffic from the blue environment to the green or to roll back to the blue if necessary. Weighted routing allows you to begin this transition with a smaller percentage of traffic.
Answer these questions. The answers follow the last question. If you cannot answer these questions correctly, consider reading this section again until you can.
1. You have deployed an Auto Scaling Group (ASG) of EC2 instances behind an Application Load Balancer (ALB). Instances are distributed across three AZs. A Route 53 alias record is used for DNS and points to the load balancer. You must now gradually migrate this traffic to a new ALB and ASG. If an AZ fails, traffic must continue to flow to the surviving instances. What is the ideal way to accomplish this migration? (Choose two.)
A. Use a weighted routing policy to send a portion of traffic to the new ALB.
B. Use the ALB to detect and recover from an AZ failure.
C. Use Route 53 failover routing to detect and recover from an AZ failure.
D. Use a latency-based routing policy to send a portion of traffic to the new ALB.
2. A restaurant hosts a website in the us-west-1 region that highlights locations on the West Coast. Visitors from California should be directed to this website. They are preparing to open a new set of locations on the East Coast and want to host a different version of the website in us-east-1. All visitors from Florida should be directed to the website in us-east-1. Visitors from all other states should get the website that is hosted in us-west-1. Which routing policy should be used?
A. Geoproximity routing
B. Geolocation routing
C. Latency-based routing
D. Weighted routing
1. Answer: A and B are correct. Weighted routing allows you to begin this transition with a smaller percentage of traffic and gradually move all traffic to the new ALB. The ALB handles availability within a region. Route 53 handles availability across regions.
2. Answer: B is correct. Geolocation routing lets you choose the resource record that will be returned based on the geographic location (state, nation, or continent) where DNS queries originate from.