Setup Cloudfront for S3
Premise
This is simple step by step guide about how to setup Cloudfront for a Static S3 site. To set this up on AWS we will need to use 4 AWS services:
S3
This is a storage platform offered by AWS. This will be where we will store our website
Cloudfront
Cloudfront is a Content Distribution Netwrok (CDN). This is what will essentially bind our SSL Certificate to your website.hero
AWS Certificate
AWS Certificate helps manage the various certifications we may will. We will use this to generate an SSL Certificate.hero
Route 53
This is our DNS (Domain Name System) web service. We will use this to point benmcphail.com to the S3 bucket.
Method
Step 1 - Create an S3 Bucket
Step 1 - Create A Cloudfront Distribution
Click
Create Distribution
and then click Get Started
for a Web Distribution
Step 2 - Distribution Settings
Select the bucket your static site will be hosted from and leave the rest blank.
Leave all of Default Cache Behavior Settings
as is.
In Distribution Settings
, add your domain names to Alternate Domain Names
: