From b5cee10dcaddc3f25d734e074171742cb4279b24 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Tue, 25 Oct 2022 15:07:07 +0200 Subject: [PATCH] Remove useless dynamic blocks --- modules/dns/main.tf | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/modules/dns/main.tf b/modules/dns/main.tf index 25286a8a..5c7113e9 100644 --- a/modules/dns/main.tf +++ b/modules/dns/main.tf @@ -30,7 +30,7 @@ locals { : ( substr(attrs.name, -1, 1) == "." ? attrs.name - : "${attrs.name}.${var.domain}." + : "${attrs.name}.${var.domain}" ) ) }) @@ -208,17 +208,13 @@ resource "google_dns_record_set" "cloud-geo-records" { type = each.value.type ttl = each.value.ttl - dynamic "routing_policy" { - for_each = each.value.geo_routing != null ? [1] : [0] - iterator = unused - content { - dynamic "geo" { - for_each = each.value.geo_routing - iterator = policy - content { - location = policy.value.location - rrdatas = policy.value.records - } + routing_policy { + dynamic "geo" { + for_each = each.value.geo_routing + iterator = policy + content { + location = policy.value.location + rrdatas = policy.value.records } } } @@ -240,17 +236,13 @@ resource "google_dns_record_set" "cloud-wrr-records" { type = each.value.type ttl = each.value.ttl - dynamic "routing_policy" { - for_each = each.value.wrr_routing != null ? [1] : [0] - iterator = unused - content { - dynamic "wrr" { - for_each = each.value.wrr_routing - iterator = policy - content { - weight = policy.value.weight - rrdatas = policy.value.records - } + routing_policy { + dynamic "wrr" { + for_each = each.value.wrr_routing + iterator = policy + content { + weight = policy.value.weight + rrdatas = policy.value.records } } }