Skip to content

Commit

Permalink
fix: syntax update to make the for loop more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
tfhartmann committed Oct 2, 2019
1 parent 3dbe020 commit 0028cd4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
]
}

/******************************************
Expand Down

0 comments on commit 0028cd4

Please sign in to comment.