How to get a Serverless web app working with your own domain and SSL on AWS, the right way

Pablo
8 min readNov 15, 2020

Recently, I built a very simple CMS software to serve as the engine for my website La Siesta Americana (literally The American Siesta, like The American Dream but lazier). Why to build a CMS in 2020? There’s actually little or no reason, but I wanted to publish my content and literally no option in the market satisfied me, so I built my own for fun and to make a statement: we need no complex services, no plugins, no templating engines, no databases to publish content.

When my good friend and business partner Pedro saw it working, suggested that I published the software, and named it “Siesta” or similar, and here we are, ten hours later. I thought a CMS worth of its name needed to be shown in action, so I decided to use it to build its own product website.

The application is based on the Serverless framework, and I wanted to deploy it to my AWS account using a custom domain, with HTTP to HTTPS redirection that worked both for the www domain and the naked version (the one with no www). So, in other words: http://siestacms.com, https://siestacms.com, http://www.siestacms.com all needed to redirect to https://www.siestacms.com seamlessly.

My final setup

I also wanted two subdomains: dev.siestacms.com to host the development stage, and prod.siestacms.com to host…

--

--

Pablo

I’ve been into software engineering for the most part of my life so I have thought long and hard about it. Now I‘m just writing it down.