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?

preguntada hace 2 años1645 visualizaciones
2 Respuestas
1
Respuesta aceptada

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
EXPERTO
Chris_G
respondido hace 2 años
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
EXPERTO
kentrad
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas