Skip to content

Commit bda5f75

Browse files
authored
revert: Create only required number of NAT gateways (#492) (#517)
1 parent 310ab7e commit bda5f75

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

examples/simple-vpc/main.tf

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ module "vpc" {
99

1010
cidr = "10.0.0.0/16"
1111

12-
azs = ["eu-west-1a", "eu-west-1b", "euw1-az3"]
13-
private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
14-
database_subnets = ["10.0.5.0/24"]
15-
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24", "10.0.104.0/24"]
12+
azs = ["eu-west-1a", "eu-west-1b", "euw1-az3"]
13+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
14+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
1615

17-
enable_nat_gateway = true
18-
# single_nat_gateway = true
16+
enable_ipv6 = true
1917

20-
create_database_subnet_group = false
18+
enable_nat_gateway = true
19+
single_nat_gateway = true
2120

2221
public_subnet_tags = {
2322
Name = "overridden-name-public"

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ locals {
55
length(var.database_subnets),
66
length(var.redshift_subnets),
77
)
8-
nat_gateway_count = var.single_nat_gateway ? 1 : var.one_nat_gateway_per_az ? length(var.azs) : local.max_subnet_length < length(var.public_subnets) ? local.max_subnet_length : length(var.public_subnets)
8+
nat_gateway_count = var.single_nat_gateway ? 1 : var.one_nat_gateway_per_az ? length(var.azs) : local.max_subnet_length
99

1010
# Use `local.vpc_id` to give a hint to Terraform that subnets should be deleted before secondary CIDR blocks can be free!
1111
vpc_id = element(

0 commit comments

Comments
 (0)