2 min read

Static website on AWS S3 bucket (SSL secure)

Static website on AWS S3 bucket (SSL secure)

Aim

Set up a static website using an S3 bucket (Amazon Web Services) as a root folder.

SSL certificate provided by Amazon.

I'll give you step by step with a my static site https://app.pimpmychef.it

Instructions

First of all, go to the S3 service page on AWS console.

Create e new bucket with the name of your site, in my example the bucket name is "app.pimpmychef.it".

Open the bucket settings and, under the "property" tab, enable "Static web site hosting" as in the screenshot below.

Now you can upload your folders containing your static website inside your new bucket.

Find the public URL of your new S3 bucket and check if the website work.

My public bucket URL is http://app.pimpmychef.it.s3-website-eu-west-1.amazonaws.com.

AWS Cloud Front for SSL and cache.

In order to enable SSL we have to create a distribution in the Cloud Front service.

So, open Cloud Front service on AWS console and click on "New Distribution". Chose the web distribution.

Below the screenshot of the settings of my CloudFront distribution for https://app.pimpmychef.it that are fine also for you; just replace app.pimpmychef.it with your domain name and select your bucket.

Last

Go to your registrant domain name and set the CNAME of your domain with the Cloud Front URL.

The cloud front url is something like d2qqeof0pxkvhj.cloudfront.net

That's all!

Tweets by YBacciarini