AWS Route 53 DNS - Failover Routing

- aws networking dns

This post is part of my note taking while studying for the AWS Certified Advanced Networking - Specialty certification.

AWS Route 53 Failover DNS Routing requires health checks on both the primary and failover record. It is used in active/passive scenarios. See the following table to see how Route 53 will respond in different scenarios.

Route 53 Failover Table

Note that when both health checks fail, the primary result will be returned. This is a design feature of Route 53 DNS.

Here’s how to setup failover routing via the AWS CLI:

failover-dns.json

{
  "Comment": "optional comment about the changes in this change batch request",
  "Changes": [
    {
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "cloudyfailover.cloudynetworks.net",
        "Type": "A",
        "SetIdentifier": "failover-primary",
        "Failover": "PRIMARY",
        },
        "HealthCheckId": "f3892edadc"
      }
    },
    {
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "cloudyfailover.cloudynetworks.net",
        "Type": "A",
        "SetIdentifier": "failover-secondary",
        "Failover": "SECONDARY",
        },
        "HealthCheckId": "f3892974dc"
    }
  ]
}


$ aws route53 change-resource-record-sets --hosted-zone-id Z1R8UBAEXAMPLE --change-batch file://failover-dns.json