Skip to content

Commit

Permalink
fix: handle case of no private zones
Browse files Browse the repository at this point in the history
  • Loading branch information
argoyle authored and peter-svensson committed Oct 5, 2021
1 parent 1f5754c commit 9c95638
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
number_of_private_zones = length(var.private_subnet_zones)
create_private_subnets = local.number_of_private_zones > 0

provided_cidrs_from_private_zones = length(var.public_subnet_cidrs) > 0 ? zipmap(var.private_subnet_zones, var.public_subnet_cidrs) : {}
provided_cidrs_from_private_zones = length(var.public_subnet_cidrs) > 0 && length(var.private_subnet_zones) > 0 ? zipmap(var.private_subnet_zones, var.public_subnet_cidrs) : {}
provided_cidrs_from_public_zones = length(var.public_subnet_cidrs) > 0 ? zipmap(var.public_subnet_zones, var.public_subnet_cidrs) : {}
provided_cidrs = local.create_private_subnets ? local.provided_cidrs_from_private_zones : local.provided_cidrs_from_public_zones

Expand Down

0 comments on commit 9c95638

Please sign in to comment.