From 48c21a91858eb904e4b1c6d6ad8e4efd22fc6683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Ahlstr=C3=B6m?= Date: Sun, 19 May 2024 18:50:09 +0300 Subject: [PATCH] add old.tietokilta.fi for old website --- modules/dns/root/main.tf | 9 +++++++++ modules/web/dns.tf | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/dns/root/main.tf b/modules/dns/root/main.tf index 6142678..bd0d016 100644 --- a/modules/dns/root/main.tf +++ b/modules/dns/root/main.tf @@ -17,6 +17,15 @@ resource "azurerm_dns_a_record" "root_a" { records = ["130.233.48.30"] } +# record for old website +resource "azurerm_dns_a_record" "old_a" { + name = "old" + resource_group_name = azurerm_resource_group.dns_rg.name + zone_name = azurerm_dns_zone.root_zone.name + ttl = 300 + records = ["130.233.48.30"] +} + # CNAME record for www. resource "azurerm_dns_cname_record" "www_cname" { name = "www" diff --git a/modules/web/dns.tf b/modules/web/dns.tf index 2a69294..9a52129 100644 --- a/modules/web/dns.tf +++ b/modules/web/dns.tf @@ -10,7 +10,7 @@ terraform { } locals { - fqdn = "${var.subdomain}.${var.root_zone_name}" + fqdn = var.subdomain == "@" ? var.root_zone_name : "${var.subdomain}.${var.root_zone_name}" } # A record for the web app