AvidDabbler Blog

AWS and the Three Bears

August 25, 2019


Getting your site hosted can be a huge hassle. There are a ton of options out there, but if you want to keep costs down choosing the next draggy-droppy solutions can get expensive and you may not want to chose a newer technology as you may have some problems (as I did) when something goes wrong. However, there is rarely the documentation that clearly spells out ONE way of doing things (but really that’s not how we learn anyway is it?).

When I first started out trying to figure out how to host my portfolio site and blog I did a ton of research on how I could host the damn thing and what I wanted to do all while learning a little about hosting. The initial goals of the project were as follows:

  1. Host a website and do so for less than a cup of coffee a month.
  2. Allow for me to update the site through a GitHub repository.
  3. Add a custom domain.
  4. Repeat the process under a subdomain for my blog.

The Problems with Hosting on GitHub

While I know that I can host a blog and and portfolio site on GitHub pages for free that would defeat the purpose of the project. I also knew that I wanted to be able to attach my project to something that would allow me to grow within a platform.

I had heard of a number of different options out there as far as cloud providers are concerned, but I ended up going with AWS just because it seems to be the most widely supported cloud platform and seemed like a good introductory project in getting involved into the ecosystem for hosting files.

Options within AWS

So this is probably the most frustrating part of the whole process for me. AWS has so many ways of doing things and there are so many different platforms out there that seemed great, but I eventually narrowed it down to 3 different options all of which I got to different levels of befor bailing to another, but I am proud to say that 3rd times the charm and that I am happy with my final choice.

As with all technology these days there is an array of trade offs that often sound constantly like one old fable or another. Today’s Story is AWS and the Three Bears.

Papa Bear Solution: EC2, Lightsail, and Apache

When I first started this process I wanted to do it all. I wanted to be up to my elbows in documentation, I wanted to host the files, manage the server, keep up with all of the dependencies. So I started working with AWS Lightsail.

The benefit of working with lightsail is that this solution is configured exactly the way that you like. I started off by getting the EC2 instance configured. I ended up using Ubuntu, getting Apache installed, struggling through documentation about hosting files. However, at the end of the day I couldn’t get it to work. BUT I learned a lot about EC2, improved my command line skills and figured out that this is not the solution for me.

If I was starting some startup and wanted to take the time to build something from scratch I would go with something along these lines, but at the end of the day this is too much of my time that I will never get back and I need to focus on other things in life other than remaining in config file hell.

Baby Bear: AWS Amplify

I really though that AWS Amplify was going to be the solution… and it was for about a week. AWS Amplify was great. No command line, direct connection to GitHub. All in all I know how to get something up and running in about 5 minutes.

AWS Amplify is a new service on AWS. So they are still kicking the tires on this. When I first uploaded my site it was great. Initialization was a breeze. Load was fast(ish). However, I went to go add another project today. My app is missing from the Amplify dashboard, but is somehow is still being hosted and I am still being charged. So my experience with it has been mixed to say the least.

Mama Bear: S3 Buckets, Cloudfront and Code

At the end of the day I have decided that the best solution is of medium configuration. It is an integration of 3 well established solutions in AWS. S3, Cloudfront, and CodeBuild. S3 will handle holding all of your data, Cloudfront will handle routing your data to url and CodeBuild will work with your repository to make sure that it updates when you update your GitHub via Webhooks.

The price of my final solution should be extremely affordable as my site at this moment is only about 5mb in total. I don’t have any information about how much it will cost me, but I will update this in the future to let you know how much I am getting charged a month on average.

Check out my next post for how I configured the whole thing

Written by Walter Jenkins who lives and works in Saint Louis. His passions are Civic Tech, Smart Cities and Alternative Transportation. He specializes in working with data analysis and visualization through maps.
You should follow him on Twitter.