Skip to content

Commit

Permalink
Revert "fix: Create only required number of NAT gateways (#492)"
Browse files Browse the repository at this point in the history
This reverts commit 712e1f9.
  • Loading branch information
antonbabenko authored Oct 6, 2020
1 parent 310ab7e commit b6df830
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions examples/simple-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ module "vpc" {

cidr = "10.0.0.0/16"

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

enable_nat_gateway = true
# single_nat_gateway = true
enable_ipv6 = true

create_database_subnet_group = false
enable_nat_gateway = true
single_nat_gateway = true

public_subnet_tags = {
Name = "overridden-name-public"
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
length(var.database_subnets),
length(var.redshift_subnets),
)
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)
nat_gateway_count = var.single_nat_gateway ? 1 : var.one_nat_gateway_per_az ? length(var.azs) : local.max_subnet_length

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

0 comments on commit b6df830

Please sign in to comment.