terraform-aws-modules / terraform-aws-vpc

Terraform module to create AWS VPC resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws
Apache License 2.0
2.92k stars 4.36k forks source link

fix: Create private_ipv6_egress routes only when having at least one private subnet #1062

Closed RunCor399 closed 2 months ago

RunCor399 commented 2 months ago

Description

Private IPv6 Egress routes are now only created when having at least a private subnet

Motivation and Context

Version 5.7.1 of the module solved the issue #1058 by limiting the amount of IPv6 egress routes created to the amount of NAT gateways provisioned (hence to the amount of Route Tables created).

However the condition that regulates the number of IPv6 egress routes created doesn't check if the creation of any private subnet is actually wanted

Breaking Changes

How Has This Been Tested?

bryantbiggs commented 2 months ago

how has this been tested and validated

RunCor399 commented 2 months ago

how has this been tested and validated

I have run the same example quoted in issue #1061 before and after my modification.

wiseelf commented 2 months ago

Maybe it makes sense to set create_egress_only_igw to false by default?

RunCor399 commented 2 months ago

Maybe it makes sense to set create_egress_only_igw to false by default?

I believe that since create_egress_only_igw is also used in the database_ipv6_egress route, setting it to false by default may cause problems when having a setup with database subnets and no private subnets (and viceversa). In the latter scenario create_egress_only_igw would have to be set to true, thus leading to the creation of routes for both private and db subnets

antonbabenko commented 2 months ago

This PR is included in version 5.7.2 :tada:

github-actions[bot] commented 1 month ago

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.