Apex and www domains with python’s Zappa (https)

Setting up Zappa via this excellent tutorial and using the Zappa built in commands (zappa certify) to link up your custom domain with your Lambda app unfortunately prevents you from using your apex/naked domain (eg smartcrowd.io) alongside your www domain (www.smartcrowd.io).

One way around this is via Route53 -> cloudfront -> S3 redirect -> your lambda app’s www endoint.

  • Set up your S3 bucket, redirecting to your lambda app. Don’t use fullstops in your bucket name…

  • Create a Cloudfront using the Endpoint of your S3 bucket as ‘Origin Domain Name’ (you should be able to select it in a drop down list):

  • Create Route53 A and AAAA records, using the Alias target of your Cloudfront:

  • Wait 30 minutes and, voila (hopefully).