From 0992a4dc905474591a43aaf5c65f1ba1db380ce2 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Mon, 13 Sep 2021 21:48:42 -0700 Subject: [PATCH] Make domain customizable --- doc/selfhosting.md | 7 +++++++ tf/acm.tf | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/selfhosting.md b/doc/selfhosting.md index d261e05..9bae4cc 100644 --- a/doc/selfhosting.md +++ b/doc/selfhosting.md @@ -122,6 +122,7 @@ Add to `.env` the following contents: # Terraform AMI_NAME=riju-web-20210711223158 AWS_REGION=us-west-1 +DOMAIN=your.domain S3_BUCKET=yourname-riju ``` @@ -141,6 +142,12 @@ The main utility of having this as an explicit environment variable is that Terraform respects it and won't always ask you what region to use. +### DOMAIN + +This is the base hostname you will be hosting Riju at (e.g. +`riju.codes`). Even if you plan to host on a subdomain of your domain, +set this to the apex. It's just used for TLS certificate provisioning. + ### S3\_BUCKET This is the name of the S3 bucket that will be used to store Riju diff --git a/tf/acm.tf b/tf/acm.tf index 2333115..6e280a9 100644 --- a/tf/acm.tf +++ b/tf/acm.tf @@ -1,6 +1,6 @@ resource "aws_acm_certificate" "riju" { - domain_name = "riju.codes" - subject_alternative_names = ["*.riju.codes"] + domain_name = data.external.env.result.DOMAIN + subject_alternative_names = ["*.${data.external.env.result.DOMAIN}"] validation_method = "DNS" tags = {