I manage a bunch of redirected subdomains. We use these with third-party applications, where the application lives at some non-Lafayette URL and we want a clean, simple Lafayette URL for our users. We call these vanity plates, and at the architectural level they’re pretty simple: a Cloudfront distribution with a certificate and LambdaEdge function to handle the redirection. We monitor the state of the redirection with a Synthetic Canary.
A small challenge is that we like to have lifecycle rules on all our S3 buckets. With the above stack we actually have three buckets:
- The logging bucket for the Cloudfront distribution
- An empty S3 bucket that serves as the unused target for the Cloudfront distribution
- The artifacts bucket for the Synthetic Canary.