Skip to content

Commit

Permalink
Add a condition to build SNAT rules only when a NAT GW is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrecarre committed Mar 4, 2021
1 parent 1480768 commit dcac70d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ locals {
vpc_subnets_map = zipmap(local.vpc_subnets_keys, local.vpc_subnets_values)

vpc_subnets_snat_cidr = flatten([for name in var.vpc_snat_subnets : [for subnet in var.vpc_subnets : subnet.subnet_cidr if subnet.subnet_name == name]])
vpc_subnets_snat_cidr_map = zipmap(local.vpc_subnets_snat_cidr, local.vpc_subnets_snat_cidr)
vpc_subnets_snat_cidr_map = var.enable_nat_gateway ? zipmap(local.vpc_subnets_snat_cidr, local.vpc_subnets_snat_cidr) : {}

}

Expand Down

0 comments on commit dcac70d

Please sign in to comment.