Any idea how to let S3 serve “maintenance mode” page?
-
22-08-2019 - |
Question
Say, you have a Rails (or actually any other kind) application running on Amazon EC2, and whenever you perform some maintenance, which might include shutting down or re-creating your instances, you might want S3 to display your "maintenance mode" page instead of your app.
So, basically, that might mean:
- Uploading text saying when you're going to be back online to S3
- ???
- S3 serving this page to any request to your domain while you perform upgrades/re-instantiating instances, etc.
- ???
- EC2 instances are back serving your customers
I understand that most probably it is not possible — at least I have no idea how to do this. Just want to make sure it is not possible.
Anyway. Any ideas? :)
Solution
I don't think it is possible with plain S3.
You can always run an EC2 instance with a minimal web server on it. It'll just cost you a few cents, assuming you're only down for a few hours. Using Elastic IPs, you don't even have to have any downtime – just switch your IP to point to the "downtime page" node, then swap it back when everything's back up and running.