How can I set up Active-Passive failover with geolocation records in Route 53?

Last updated: 2020-02-07

I have a geolocation record that points to a load balancer in one location. I want to configure a secondary geolocation record for the same location. With this configuration, if the primary record becomes unhealthy, Amazon Route 53 automatically fails over to the secondary record. How can I set up Active-Passive failover with geolocation records in Route 53?

Short Description

Consider a scenario where a geolocation record was created for clients in Location A to access a load balancer in us-west-1. Another geolocation record was created for clients in Location B to access the load balancer in eu-west-1. There's also a default geolocation record that points to a static webpage showing that the service is unavailable to clients outside of Location A and Location B.

If a record is unhealthy, then Route 53 looks for a record for the larger, associated geographic Region. Because the geolocations aren't associated, Route 53 fails over to the default record when the geolocation record for Location A becomes unhealthy. However, you can configure Route 53 to instead fail over to the load balancer in eu-west-1.

For clients in Location A:

  • Create a primary failover record (failover.example.com) that points to the load balancer in us-west-1
  • Create a secondary failover record that points to the load balancer in eu-west-1
  • Create a geolocation record for Location A (locationa.example.com) that points to the primary failover record (failover.example.com)

When DNS queries that originated from Location A are received now, Route 53 selects the geolocation record for Location A (locationa.example.com) that points to the primary failover record (failover.example.com). Route 53 returns the primary record if it's healthy. If the primary record is unhealthy, then Route 53 fails over and returns the healthy secondary record. To complete the Active-Passive failover configuration between the two locations, repeat the steps above for clients in Location B.

Resolution

Create a failover record

  1. Open the Route 53 console.
  2. In the navigation pane, choose Hosted zones.
  3. Choose the name of the desired hosted zone.
  4. Choose Create Record Set.
  5. For Name, specify a name for the failover record.
  6. For Alias, choose Yes.
  7. For Value, select your target (such as the load balancer) for Location A.
  8. For Routing Policy, choose Failover.
  9. For Failover Record Type, choose Primary.
  10. For Evaluate target health, choose Yes.
  11. Choose Create.
  12. Choose Create Record Set to create the secondary record.
  13. For Name, enter the name that you specified for the primary record in step 5.
  14. For Alias, choose Yes.
  15. For Value, select your target (such as the load balancer) for Location B.
  16. For Routing Policy, choose Failover.
  17. For Failover Record Type, choose Secondary.
  18. (Optional) For Evaluate target health, choose Yes.
  19. Choose Create.

Create a geolocation record targeting the failover record

  1. Open the Route 53 console.
  2. In the navigation pane, choose Hosted zones.
  3. Choose the name of the desired hosted zone.
  4. Choose Create Record Set.
  5. For Name, specify a name for the geolocation record.
  6. For Type, choose the same type that you used for the failover record.
  7. For Alias, choose Yes.
  8. For Alias Target, enter the name of the failover record.
  9. For Routing Policy, choose Geolocation.
  10. For Location, choose Location A's geographic location.
  11. For Set ID, enter a description for the record set.
  12. For Evaluate target health, choose Yes.
  13. Choose Create.

Note: Be sure to use the same DNS record type for all of the records. For example, if you create an A record for the primary failover record:

  • The secondary failover record must also be an A record
  • The geolocation record must be a Type A Alias record

Did this article help you?

Anything we could improve?


Need more help?