Reputation: 42604
I deployed my service to AWS lambda and put API gateway in front of them. API gateways are deployed to AWS multiple regions and I am thinking to build a router to route the traffic to different region based on health check.
I found both route53 and ALB support heath check and fail over to different region. The question is I am using route53 as DNS resolver and add API gateway endpoint as CNAME. Do I need ALB to route the traffic based on health check or is route53 health check good enough?
Upvotes: 1
Views: 365
Reputation: 41
No, you don't need ALB for this. Route53 Provide Active-active and active-passive failover service. you can use any as per your requirement.
Active-active and active-passive failover or you can combine multiple. for the API I recommend to go with Active-active. here is the steps can help you for quick create it.
Active-active failover
Active-active DNS failover returns multiple resources to DNS queries. When one resource is unhealthy, Route 53 fails over to another resource.
Note: Make sure to create a Route 53 health check for both resources before proceeding.
Create a record for each resource using the values for failover alias records. For each record, do the following:
List item Enter a Name for your resource (such as resource.example.com). Note: Make sure to use the same Name for each record.
Choose a record Type (such as A – IPv4 address). Note: All of the records for the resources must be the same Type.
For Alias, choose Yes. For Alias Target, enter the DNS name of your resource. The Alias Hosted Zone ID then appears.
Choose a Routing Policy and enter the appropriate values for that policy (such as Weight for a Weighted policy). For Set ID, enter a unique name for this resource (such as Resource 1). Note: For a weighted routing policy, set all records to equal weight (such as 10). Or, set all records to different weights (such as 20 and 10, where the 20 record receives twice as much traffic).
For Evaluate Target Health, choose Yes.
For Associate with Health Check, choose Yes.
For Health Check to Associate, choose the health check that you created for this resource. Choose Create to create your record.
Upvotes: 2