From 0fcd24aba1ee143f1c81947be74bd1e9c61be56d Mon Sep 17 00:00:00 2001 From: Adam Guderski Date: Wed, 24 Apr 2024 12:51:38 +0200 Subject: [PATCH] [#849] Configure sanchogov.tools sub-domain for the analytics service This adds Terraform code that creats "participation" subdomains for each environments. The exception is the beta environment, where DNS records are not handled with TF, but need to be created manually. --- infra/terraform/modules/govtool-ec2/main.tf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/infra/terraform/modules/govtool-ec2/main.tf b/infra/terraform/modules/govtool-ec2/main.tf index 40ad6f6cd..bddf37ce7 100644 --- a/infra/terraform/modules/govtool-ec2/main.tf +++ b/infra/terraform/modules/govtool-ec2/main.tf @@ -193,3 +193,12 @@ resource "aws_route53_record" "frontend" { ttl = 180 records = [aws_eip.govtool.public_ip] } + +resource "aws_route53_record" "participation" { + count = var.app_env == "beta" ? 0 : 1 + zone_id = var.dns_zone_id + name = "${var.custom_subdomain != "" ? "participation.${var.custom_subdomain}" : "participation.${var.app_env}-${var.cardano_network}"}" + type = "A" + ttl = 180 + records = [aws_eip.govtool.public_ip] +} \ No newline at end of file