This is the template discussed in the previous post for serving a static website stored in S3 through CloudFront.
Enabling HTTPS Previously our website was served directly from S3 which meant our friendly domain name (e.g. blog.m-taylor.co.uk) could not deliver content via HTTPS.
Adding in CloudFront removes this limitation. Our Route53 record points at CloudFront where the custom domain is configured. CloudFront is terminating the SSL with our ACM certificate so the visitor will receive that all important green tick in their browser.
Launching the CloudFormation template in the previous post will create our s3-website, however it will not be available over HTTPS. Out of the box there are some limitations with s3-website relating to serving secure content.
The Route53 record directs to an endpoint hosted by AWS, for example in eu-west-1 the endpoint is s3-website-eu-west-1.amazonaws.com. This endpoint does not accept HTTPS connections. Even if the endpoint did accept HTTPS connections the visitors web browser would return a certificate mismatch error.
Before going any further with improving the website I wanted to create a CloudFormation template for the technical design so far described in Hello Hugo.
This template, written in YAML, will:
Create an S3 Bucket Create an S3 Bucket Policy allowing Public Read on all objects in the bucket Point a Route53 DNS Record at the newly created bucket All that is required when creating the stack is:
As previously mentioned in Hello World this website is built by a static site generator named Hugo. Not to detract from the excellent introduction on the Hugo homepage, Hugo will generate all pages of this website only when the content is updated, and store the result in standard HTML files.
Traditional Content Management Systems (CMS) run on a server-side language such as PHP, ASP.NET, or Java, and along with a database, will render a webpage each and every time it is requested by a website visitor.
I’ve lost count the number of times I tried to start writing my own blog. They never really had a focus. I treated them as a diary of sorts, which contained way too personal information and therefore never got published anywhere but my own computer.
This time I’m determined!
I work at Cloudreach, a cloud consultancy, as a systems engineer. I get to use plenty of modern cloud technologies daily, but there are countless other systems, applications, methodologies, and cloud features that I don’t get chance to look at.