Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Route 53 Redirect to Status Page

First question, so if I get this wrong somehow be kind.

We are using Route 53 with Amazon and have our primary front end servers behind an ELB. Our app also routes all requests through HTTPS. We are utilizing an offsite status page via statuspage.io.

What I am trying to accomplish is if the primary site goes down I'd like to have R53 redirect both the SSL and non-SSL traffic to our status page.

I originally had tried setting up a static page in S3 but still had issues with HTTPS requests made on our site.

Has anyone done this successfully? I imagine it has to be possible, but its definitely outside my realm of expertise.

Thank you very much for your time and help.

like image 835
Daniel Avatar asked Sep 29 '22 19:09

Daniel


2 Answers

You are right, S3 website doesn't support HTTPS. However, CloudFront does[1]. What you can do is failover to CloudFront and have your origin be your S3 website or your statuspage.io.

Steps:

  1. Create a distribution and set the CNAMEs to match your DNS entries.
  2. Upload and associate your SSL cert with your distribution
  3. Update failover target to be your CloudFront distribution and set it as an alias.

[1] http://aws.amazon.com/about-aws/whats-new/2014/03/05/amazon-cloudront-announces-sni-custom-ssl/

like image 52
imperalix Avatar answered Oct 04 '22 04:10

imperalix


Route53 is managing the DNS which is not what you want to do (even if you'd change the DNS it would take TTL to sync). What you should do is use a combination of auto-scaling policies and health-checks. These health-checks will be performed by the ELB every 30 seconds and if two consecutive checks will fail it'll mark the instance as out-of-service and will stop directing traffic to it (the ELB is directing traffic to your instances in a round-robin manner).

Having more than one instance and using auto-scaling rules is the key: it will enable AWS to terminate the unhealthy instance and spin up a new instance instead (in the same ASG with the same AMI etc).

like image 41
Nir Alfasi Avatar answered Oct 04 '22 03:10

Nir Alfasi