From 9b28310b4533040580918ac6fd13628d93ffb479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20Hu=CC=88bner?= Date: Sun, 9 Jul 2023 16:27:03 +0200 Subject: [PATCH] Chore: minor cleanup --- main.tf | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/main.tf b/main.tf index eba9aee..8a9f717 100644 --- a/main.tf +++ b/main.tf @@ -27,23 +27,13 @@ data "cloudflare_zone" "zone" { name = each.key } resource "cloudflare_record" "myrecord" { -for_each = { for record in local.zone_data : "${record.record_type}${record.extra_data}-${record.record_name}.${record.zone_name}" => record } - +for_each = { + for record in local.zone_data : "${record.record_type}${record.extra_data}-${record.record_name}.${record.zone_name}" => record } zone_id = data.cloudflare_zone.zone[each.value.zone_name].id - name = "${each.value.record_name}.${each.value.zone_name}" == "@.${each.value.zone_name}" ? "${each.value.zone_name}" : "${each.value.record_name}.${each.value.zone_name}" - type = each.value.record_type - value = each.value.record_value - ttl = 300 - priority = each.value.record_type == "MX" ? tonumber(each.value.extra_data) : 0 -} - - - - - - - - - - + name = "${each.value.record_name}.${each.value.zone_name}" == "@.${each.value.zone_name}" ? each.value.zone_name : "${each.value.record_name}.${each.value.zone_name}" + type = each.value.record_type + value = each.value.record_value + ttl = 300 + priority = each.value.record_type == "MX" ? tonumber(each.value.extra_data) : 0 +} \ No newline at end of file