From 0028cd4963967ba0b6f7007a586088a5cfdcf2bf Mon Sep 17 00:00:00 2001 From: Tim Hartmann Date: Wed, 2 Oct 2019 10:48:58 -0400 Subject: [PATCH] fix: syntax update to make the for loop more readable --- main.tf | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index c087f4c8c..30bf0fccd 100644 --- a/main.tf +++ b/main.tf @@ -53,8 +53,17 @@ resource "google_compute_subnetwork" "subnetwork" { enable_flow_logs = lookup(each.value, "subnet_flow_logs", "false") network = google_compute_network.network.name project = var.project_id - secondary_ip_range = [for i in range(length(contains(keys(var.secondary_ranges), each.value.subnet_name) == true ? var.secondary_ranges[each.value.subnet_name] : [])) : var.secondary_ranges[each.value.subnet_name][i]] description = lookup(each.value, "description", null) + secondary_ip_range = [ + for i in range( + length( + contains( + keys(var.secondary_ranges), each.value.subnet_name) == true + ? var.secondary_ranges[each.value.subnet_name] + : [] + )) : + var.secondary_ranges[each.value.subnet_name][i] + ] } /******************************************