Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
imrannayer authored Dec 25, 2023
2 parents 8a5499c + 2adc566 commit 4b67a9f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
18 changes: 8 additions & 10 deletions modules/subnets-beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@ resource "google_compute_subnetwork" "subnetwork" {
network = var.network_name
project = var.project_id
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]
]
dynamic "secondary_ip_range" {
for_each = contains(keys(var.secondary_ranges), each.value.subnet_name) == true ? var.secondary_ranges[each.value.subnet_name] : []

content {
range_name = secondary_ip_range.value.range_name
ip_cidr_range = secondary_ip_range.value.ip_cidr_range
}
}

purpose = lookup(each.value, "purpose", null)
role = lookup(each.value, "role", null)
Expand Down
18 changes: 8 additions & 10 deletions modules/subnets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@ resource "google_compute_subnetwork" "subnetwork" {
network = var.network_name
project = var.project_id
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]
]
dynamic "secondary_ip_range" {
for_each = contains(keys(var.secondary_ranges), each.value.subnet_name) == true ? var.secondary_ranges[each.value.subnet_name] : []

content {
range_name = secondary_ip_range.value.range_name
ip_cidr_range = secondary_ip_range.value.ip_cidr_range
}
}

purpose = lookup(each.value, "purpose", null)
role = lookup(each.value, "role", null)
Expand Down

0 comments on commit 4b67a9f

Please sign in to comment.