terraform-aws-vpc
terraform-aws-vpc copied to clipboard
Using create_database_nat_gateway_route=false still creates the NAT GW route in DB RT
Description
When using the flag create_database_nat_gateway_route = false
I was expecting that the database subnets to not have a 0.0.0.0/0
route to a NAT GW.
Versions
-
Module version: v3.4.12
-
Terraform version: v1.1.9
-
Provider version(s):
- provider registry.terraform.io/hashicorp/aws v4.22.0
Reproduction Code
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
cidr = "172.20.0.0/16"
azs = ["us-east-1a", "us-east-1b"]
private_subnets = ["172.20.0.0/24", "172.20.1.0/24"]
public_subnets = ["172.20.32.0/24", "172.20.33.0/24"]
database_subnets = ["172.20.34.0/24", "172.20.35.0/24"]
enable_nat_gateway = true
enable_vpn_gateway = false
enable_dns_hostnames = true
enable_dns_support = true
create_database_nat_gateway_route = false
create_database_internet_gateway_route = false
Steps to reproduce the behavior:
Just execute the TF code above.
Expected behavior
When using the flag create_database_nat_gateway_route = false
I was expecting that the database subnets to not have a route to a NAT GW.
Actual behavior
The database subnets route tables have a route to the NAT GW.
By not specifiying create_database_subnet_route_table=true
, the db subnet is being associated with a private route table which has NAT GW route rule.
This might just be a question of adding the use case to the documentation? Or a improvement needed in https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/main.tf#L1092
Same issue here...
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
Still valid. Commenting to prevent closure.
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
Still a problem as of now. Commenting here to remove the stale flag.
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
Still a problem as of now. Commenting here to remove the stale flag.
On top of this, create_database_nat_gateway_route = true
attempts to create NAT GW route in a private subnet instead of DB subnet.
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.