From c3e0bc54cc8b96640ecd65bd37f5a46380d4fdd4 Mon Sep 17 00:00:00 2001 From: John Ake Date: Mon, 18 Dec 2023 16:50:36 +0000 Subject: [PATCH] WIP --- dns/zones/resources.tf | 11 ++++++++++- domains/infrastructure/variables.tf | 13 +------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dns/zones/resources.tf b/dns/zones/resources.tf index 5c9f14c..ce136ab 100644 --- a/dns/zones/resources.tf +++ b/dns/zones/resources.tf @@ -33,7 +33,7 @@ resource "azurerm_dns_caa_record" "caa_records" { for zone in local.caa_records : "${zone.zone_name}.${zone.record_name}" => zone } - name = each.value.record_name + name = "@" zone_name = each.value.zone_name resource_group_name = each.value.resource_group_name ttl = 300 @@ -44,6 +44,15 @@ resource "azurerm_dns_caa_record" "caa_records" { value = each.value.value } + dynamic "record" { + for_each = var.settings + content { + flags = 0 + tag = "issue" + value = record.value.value + } + } + depends_on = [ azurerm_dns_zone.dns_zone ] diff --git a/domains/infrastructure/variables.tf b/domains/infrastructure/variables.tf index c75ab38..a1c6edc 100644 --- a/domains/infrastructure/variables.tf +++ b/domains/infrastructure/variables.tf @@ -22,18 +22,7 @@ variable "azure_enable_monitoring" { locals { default_records = { - "caa_records" = { - "@" = { - "flags" = 0, - "tag" = "issue", - "value" = "globalsign.com" - }, - "@" = { - "flags" = 0, - "tag" = "issue", - "value" = "digicert.com" - } - } + "caa_records" = ["globalsign.com", "digicert.com"], "txt_records" = { "@" = { "value" = "v=spf1 -all"