How to setup maintenance page in AWS without modifying Cloudfront?

Viewed 569

We will be deploying changes in our production environment and would like to put up a maintenance page during the deployment. No redirection to error page but simply display the maintenance page when they hit our website. Our current production setup is, DNS->cloudfront->S3 object (mydomain.test.com). Our staging is, DNS->R53->Cloudfront->S3 (mydomain.staging.test.com->mydomain.staging.test53.com). I would like to test this first in our Staging env so that if it works, I will have the DNS entry of our prod env modified and pointed to a new R53 I will create.

What I've done so far is, create an S3 bucket that has the maintenance.html object, created a Cloudfront and R53 solely for the maintenance page. Added the S3 object as the default root object in the CF and mydomain.staging.maintenance.test53.com as alias. Also added the CF as the cname in the R53. So when I load the r53 mydomain.staging.maintenance.test53.com I see the maintenance page.

However, for this to work I have to update the CF of our live environment to remove mydomain.staging.test.com and mydomain.staging.test53.com and add mydomain.staging.maintenance.test53.com as alias then update the staging live R53 to point to the maintenace R53. This works but the CF changes takes time to propagate.

Would appreciate any suggestions!

0 Answers
Related