diff --git a/domains/environment_domains/dns.tf b/domains/environment_domains/dns.tf index 6a2177c..cba8dcc 100644 --- a/domains/environment_domains/dns.tf +++ b/domains/environment_domains/dns.tf @@ -5,7 +5,7 @@ data "azurerm_dns_zone" "main" { resource "azurerm_dns_txt_record" "main" { for_each = { for k in toset(var.domains) : k => k if !startswith(k, "apex") } - name = join(".", ["_dnsauth", "${each.key}"]) + name = join(".", ["_dnsauth", each.key]) zone_name = data.azurerm_dns_zone.main.name resource_group_name = var.resource_group_name ttl = 300 diff --git a/domains/environment_domains/front_door.tf b/domains/environment_domains/front_door.tf index dcaac0e..cbe1933 100644 --- a/domains/environment_domains/front_door.tf +++ b/domains/environment_domains/front_door.tf @@ -36,7 +36,7 @@ resource "azurerm_cdn_frontdoor_custom_domain" "main" { name = replace(each.key, ".", "-") cdn_frontdoor_profile_id = data.azurerm_cdn_frontdoor_profile.main.id dns_zone_id = data.azurerm_dns_zone.main.id - host_name = startswith(each.key, "apex") ? "${var.zone}" : "${each.key}.${var.zone}" + host_name = startswith(each.key, "apex") ? var.zone : "${each.key}.${var.zone}" tls { certificate_type = "ManagedCertificate" minimum_tls_version = "TLS12" diff --git a/domains/environment_domains/front_door_rules.tf b/domains/environment_domains/front_door_rules.tf index 29bcbb2..97423c1 100644 --- a/domains/environment_domains/front_door_rules.tf +++ b/domains/environment_domains/front_door_rules.tf @@ -17,7 +17,7 @@ resource "azurerm_cdn_frontdoor_rule" "rule" { conditions { host_name_condition { operator = "Equal" - match_values = [for d in [var.redirect_rules[count.index]["from-domain"]] : startswith(d, "apex") ? "${var.zone}" : "${d}.${var.zone}"] + match_values = [for d in [var.redirect_rules[count.index]["from-domain"]] : startswith(d, "apex") ? var.zone : "${d}.${var.zone}"] } } diff --git a/domains/environment_domains/variables.tf b/domains/environment_domains/variables.tf index 1ae115d..815b0e8 100644 --- a/domains/environment_domains/variables.tf +++ b/domains/environment_domains/variables.tf @@ -44,7 +44,7 @@ variable "exclude_cnames" { variable "redirect_rules" { nullable = false - default = {} + default = [] description = <