Mathieu's blog

Deploy a static site to AWS with S3 and CloudFront

Navigating the AWS console is always a challenge. To host this webpage, I'm using 3 very basic services: s3 for storing all files (.html, .css, .png, etc.), Route53 to handle DNS records, and CloudFront to cache and serve the content of the bucket. This makes a very efficient solution, that does not require to maintain any virtual machine, but combining all theses services was not that intuitive. Hopefully this tutorial can be of help!

S3 Console

As for the bucket creation, things are simple here!

aws s3 sync my_local_folder s3://my_bucket_name

CloudFront Console

This part is the most tricky one. Although it seems AWS has somehow made this easier by automatically updating the bucket access rights when following these steps.

First, create a distribution, keeping it close the default settings.

Then, in the newly created distribution, tune the following settings. In the first tab:

Route53 Console

Follow these steps:

Go to www.my-domain.com and cross your fingers. Hopefully you will see the content you uploaded to your bucket!