Migrating to S3 from ec2
Static websites can be hosted on AWS S3 for a stable platform. This is a rough idea of 'what to do'. Instructions here may not be detailed and need you to search 'how to do'.
-
Create an S3 bucket with hostname and region.
If your website should be at example.com, create a bucket with the nameexample.com
-
Upload all your static files (*.html, *.css, *.js, images, etc.) in this bucket. Use
s3cmd
or prettiest AWS dashboard. -
Make all files public. Otherwise, users would see a 403.
-
Set
static website hosting
for your website. You can do this by right click on bucket --> properties. -
Your website should be now running smoothly on url like s3.blahblah.example.com
-
Once you ensure everything is working, change your routes. Make a route53 entry to make your domain point to your bucket.
-
If you were using Cloudfront and want to continue using it, change distribution settings and set origin to S3 bucket. Make sure you've uploaded certificates on AWS, if your website is on https.
Alas! Done.