Everyone's talking DevOps, continuous delivery and continuous integration, so I thought it would be a good exercise to leverage my new found skills on AWS to build and deploy a static site using a modern pipeline, VSCode and GitHub while supporting encryption on the website more ...
Base assumptions you have an AWS Free Tier account, you love to learn and not afraid to leverage the web for help. I’m sure I’ve probably missed one or two key configurations along the way.
Create the domain
Outside of the free tiering, Amazon charges $12.00 a year for registering a new domain name and $0.50 a month for supporting the hosting of that domain. If you are not actively using your domain, make sure you clean up so you are not charged month over month.
Use S3 for Web Site Hosting
The easiest and cheapest way to demonstrate the code pipeline is to create a couple of S3 buckets with the same name as the domain name created above like geoffmccormack.com and www.geoffmccormack.com.
geoffmccormack.com will have one file ‘index.html’ and www.geoffmccormack.com will be configured to redirect traffic beginning with www to the hosted site.
The link below (and subsequent links) will provide the details to create the S3 buckets, the correct policy for website use and the Route 53 configuration to redirect the custom domain name above to the S3 bucket.
Next I decided to leverage my existing GitHub account and created a brand new repository for my single ‘index.html’ file. That way I could make changes and have a free place to manage source control. Probably I don’t want to get into all the details of creating a GitHub account here or using VSCode, but the really cool part of leveraging Git was the ability to integrate VSCode, GitHub and AWS CodePipeLine to deploy changes made to ‘index.html’ immediately to geoffmccormack.com.
This article from Sithum on Medium was simple to understand and execute.
To pull in a git repository, use the Git Clone option in the VS Code command palette.
Use HTTPS for all traffic on the Website
To force HTTPS for all traffic to the website we need to do enable additional services and finish with a couple of other configurations.
Firstly, create the SSL Certificate. This uses AWS Certificate Manager
Secondly, create a CloudFront Distribution
To use HTTPS with S3 we have to use CloudFront distribution, since there’s a capability available to redirect all traffic from HTTP to HTTPS.
There is a cost associated with this so if you are in the free-tier select use only US, Canada and Europe for the distribution. If you only have a couple of files the cost will be minimal.
As of the time of writing – in the tutorial below, there is one change. For the SSL certificate – use the certificate you created in the last section not the default cloudfront.net cert.
Once the deployment has occurred, it takes about 15 minutes, you will see a URL similar to this http://d111111abcdef8.cloudfront.net in the CloudFront Dashboard. Make sure the URL and content work by copying the URL to a browser and including the /index.html at the end.
Update the Hosted Zone with CloudFront distribution
The final step. Update the Route 53 Record set to the CloudFront distribution created above. Replace the geoffmccormack.com original alias created with the S3 bucket target with the URL for the CloudFront distribution
August was another great month for new bands, songs and old favourites
The Royal Landscaping Society - Goodbye
Noel Gallagher's High Flying Birds - This is the Place
Another foot stomper with an eye to the 70's and further drift from the his sounds of the past
Shed Seven - Devil in Your Shoes
Great song to sing along to in the car.
David Gray - Nightblindness
David Gray live in 2019 was one of my highlights of the summer. Amazing vocals and very underappeciated. This never gets old
David Bowie - Wild is the Wind
Stumbled across this on You Tube. Brilliant.
Desperate Journalist - Distance
Another recent find for me. Three albums in they deserve to be heard
Kate Bush - Running up that Hill
One of the best songs of all time. Never ages.
The Cure - Shake Dog Shake
The Cure at Glastonbury this summer was a hell of a show. Listening to 6 Music streaming in the basement it was a Sunday evening treat. Shake Dog Shake was the best of the setlist.