Moving my blog to AWS

April 2019 · 2 minute read · tech aws

Up until now my blog has been hosted on the Google Cloud Platform (GCP). At work I’m in studying for the Amazon Web Services (AWS) Developer Associate Certificate so I wanted some more hands on experience with AWS. Solely for the sake of learning I have moved my blog from GCP to AWS.

On GCP I was running the following setup:

On AWS the setup for this supposedly simple static site is more complex, though no more needing to maintain the server instance. I’m running:

There is good documentation published by AWS on how you can set this up yourself. A couple of things I noted following this setup.

Deployment

In my old setup the deployment script was a simple rsync. Here it isn’t much more complicated. It uploads the files to S3 and then invalidates the Cloudfront cache so that changes are immediately reflected.

hugo 
cd public && aws s3 sync --acl public-read . s3://www.isthisit.nz

aws cloudfront create-invalidation --distribution-id ABCDEF --paths '/*'