Using Route53 Health Checks and Failover in front of CloudFront Distribution

0

My architecture looks like:

  • Route 53 --> CloudFront --> Application Load Balancer --> EC2 Servers

I want to set up failover routing so that if the EC2 Servers go down, Route53 sends our traffic to an S3 bucket with a simple error page as a static site.

This all seems pretty straightforward, but when I try to set up failover routing on the DNS record, the option to "Evaluate Target Health" is grayed out:

Screenshot of setting up the record

This seems to be because the target is a CloudFront distribution. If I switch it to a different kind of alias, the option is no longer grayed out.

How can I proceed to set up the failover DNS if I can't monitor the target's health?

已提问 2 年前1645 查看次数
2 回答
1
已接受的回答

Hello,

"Evaluate Target Health" works with Alias Records that support health checks, CloudFront is not a service supported as it does not return health checks.

I think a better option for you is to use CloudFront's custom error responses. This way if there is an error coming from the ALB, it can redirect traffic to a custom static page hosted on an S3 bucket.

See documentation here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GeneratingCustomErrorResponses.html

profile pictureAWS
专家
Chris_G
已回答 2 年前
0

Another option is to front the site with CloudFront and use an origin group with one origin being the ELB and the other origin being the S3 static page. You would use the NoCache policy so that each request is sent to the origin instead of caching. See: Optimizing high availability with CloudFront origin failover.

profile pictureAWS
专家
kentrad
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则