Remove useless dynamic blocks

This commit is contained in:
Julio Castillo 2022-10-25 15:07:07 +02:00
parent 6340286fa4
commit b5cee10dca
1 changed files with 15 additions and 23 deletions

View File

@ -30,7 +30,7 @@ locals {
: ( : (
substr(attrs.name, -1, 1) == "." substr(attrs.name, -1, 1) == "."
? attrs.name ? 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 type = each.value.type
ttl = each.value.ttl ttl = each.value.ttl
dynamic "routing_policy" { routing_policy {
for_each = each.value.geo_routing != null ? [1] : [0] dynamic "geo" {
iterator = unused for_each = each.value.geo_routing
content { iterator = policy
dynamic "geo" { content {
for_each = each.value.geo_routing location = policy.value.location
iterator = policy rrdatas = policy.value.records
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 type = each.value.type
ttl = each.value.ttl ttl = each.value.ttl
dynamic "routing_policy" { routing_policy {
for_each = each.value.wrr_routing != null ? [1] : [0] dynamic "wrr" {
iterator = unused for_each = each.value.wrr_routing
content { iterator = policy
dynamic "wrr" { content {
for_each = each.value.wrr_routing weight = policy.value.weight
iterator = policy rrdatas = policy.value.records
content {
weight = policy.value.weight
rrdatas = policy.value.records
}
} }
} }
} }