Cloud, DevOps, Evangelism

Moving to S3 and CloudFront

Last yeah I posted about the process of converting my blog to a ‘static’ site vs. Wordpress, and what that took.

One of the choices I made at that time was to host the site using GitHub Pages because of the ease of use. Publishing was a simple matter of git commit && git push so its was great.

However, I did find a few things over the last year I wasn’t a fan of. I really liked using Jekyll, but I didn’t like:

  1. GitHub Pages are hosted in the US, and some of my metrics showed that users outside the US had pretty poor response times.
  2. GitHub Pages is limited to Jekyll 2.4, which is solidly out of date.
  3. GitHub Pages doesn’t allow for many plugins to be used (because they are running the build process), which limited my options.

So I went looking around for another option. I decided, given that my site is a static set of pages generated by Jekyll that I could use a number of methods, including setting up a webserver on AWS or something. However, that made me responsible for a webserver :(.

Instead, I decided to go with hosting the site on AWS S3, which allows for direct serving using their infrastructure - that way I dont have to run a webserver.

I eventually found a tool called s3_website, which is specifically designed for pushing Jekyll and other static sites directly to S3, and manage that whole sync/push process.

Setting it up was a simple matter of running s3_website cfg create to create the basic config file, adding my AWS credentials to the s3_website.yml file and running s3_website cfg apply to set things up. Finally, I simply run s3_website push to push any changes.

Now, the nice thing here is that the tool ALSO manages AWS CloudFront for you, which is Amazon’s Content Delivery Network. If you request to use it, all your content gets delivered all over the world, automatically. This improved performance for users outside the US.

So, with these changes, I address the issues noted above, at the cost of having to run s3_website push in addition to git commit && git push everytime I write a post.

I think its worth it.