It’s been a long time since I’ve written my own thing from the ground up. How long, you may ask? Since shared hosting was the only game in town other than colo. That’s a long time. Shared hosting was great. Someone else took care of the servers and networks and firewalls, you were only responsible for the code. I’ve missed tinkering around on side projects, no matter how ridiculous they become and even if they amount to nothing. So it’s time to tinker a little.
There are plenty of shared hosting services around, and they’re great (this blog is hosted on one, as are a few other sites I maintain). But I wondered, can I replicate the shared hosting model in AWS? Or get close? I’ve built some pretty big APIs and data services in AWS, but I’ve never really explored the website hosting aspects. As an AWS Community Builder (curious, check out https://aws.amazon.com/developer/community/community-builders/), we get credits to do exactly this type of tinkering. I’d also like to use AWS because I may want to expand into trying other services. And, IaC if possible, probably Pulumi since it also supports C# and Python. I know a tiny amount about Pulumi, but YOLO.
The stack I want to use is .NET Core, Windows or Linux (doesn’t matter any more with .NET), a relational database but not I’m not partial to MySQL or PostgreSQL, since SQL Server is very difficult to host properly in AWS. Again, I’m more interested in the tinkering with code than the hosting aspects, so I want as much managed as possible. Just like old times.
AWS has an overview of its website hosting options at https://aws.amazon.com/websites/. I won’t be using static pages, so I can eliminate S3 as an option. Since I want to use ASP.NET server side scripting, that eliminates Amplify, so Amazon Lightsail it is. Of course it can run containers, which weren’t a thought until now.
Lightsail is not as well documented as other AWS services. There is a documentation mini-site at https://lightsail.aws.amazon.com/ls/docs/en_us/all, but also some courses on Cloud Academy (https://cloudacademy.com/search/?q=lightsail). I’ll have to check these out, Cloud Academy has good content and AWS CBs have a complimentary subscription. The documentation makes Lightsail a bit of an enigma, and makes me a little hesitant that this service is only half-baked, but hey, sometimes it’s about the journey.
Lightsail has a lot of cool capabilities. I’ll be running either a virtual private server (VPS) or a container. As with shared hosting services, it has some preconfigured applications like WordPress, GitLab, Plesk, Drupal, Ghost, Joomla and more (see https://aws.amazon.com/lightsail/features/). MySQL and PostgreSQL are available, plus block and object storage. The object storage is based on S3 but is simplified (ref. https://lightsail.aws.amazon.com/ls/docs/en_us/articles/buckets-in-amazon-lightsail). For scaling, there is a CDN and load balancers which can be added on later.
This is clearly going to be a series, posted at irregular intervals, but there is a lot to look forward to tinkering with in Lightsail.
Side Project Chronicles, ep. 1: Hosting (this post)
Side Project Chronicles, ep. 2: Tour of the Lightsail Control Panel