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.97k stars 4.42k forks source link

Support mixed IPAM / manual allocation in VPC CIDRs #1048

Closed med-94 closed 5 months ago

med-94 commented 7 months ago

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

Currently when using IPAM to allocate VPC CIDRs you can only provision both v4 and v6 CIDRs out of IAPM, or neither. We'd like to be able to provision only the v6 CIDR from IPAM (So we can use our own v6 range) while passing a v4 CIDR manually (In particular for our use case our VPC needs multiple CIDRs, which is not currently possible in this module using IPAM).

Describe the solution you'd like.

I think there are two options for implementation, either splitting the use_ipam_pool flag into two flags, one for v4 and one for v6, or allowing the case where use_ipam_pool is true but one of the ipv4_ipam_pool_id or ipv6_ipam_pool_id is not set (and in that case falling back to the cidr_block and ipv6_cidr_block respectively).

The first option feels a bit neater and more explicit to me, but would be a breaking change, so the second option might be better to prevent this.

Describe alternatives you've considered.

We considered previewing several CIDRs from IPAM, then passing the extra ones in as additional CIDR blocks, but this feels quite hacky. A slightly neater alternative would also be to add support for using IPAM to provision additional CIDRs, as it looks like the aws_vpc_ipv4_cidr_block_association resource does support IPAM, but we'd prefer to just manually allocate the v4 space.

Additional context

github-actions[bot] commented 6 months ago

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

github-actions[bot] commented 5 months ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 4 months ago

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.