Skip to content

Allow using IPv6 blocks smaller than /56 for VPCs (e.g. /60 from IPAM) #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rootops opened this issue Apr 29, 2025 · 0 comments
Open

Comments

@rootops
Copy link

rootops commented Apr 29, 2025

Hi 👋

In the current module, IPv6 subnets are calculated using this logic:

cidrsubnet(aws_vpc.this[0].ipv6_cidr_block, 8, var.private_subnet_ipv6_prefixes[count.index])

This assumes the VPC always receives a /56 IPv6 block, and splits it into /64 subnets (which AWS requires).

However, when using custom IPAM pools, it's valid and sometimes desirable to assign smaller blocks like /60 to each VPC (e.g. to fit multiple VPCs into a /48 pool).

Because newbits is hardcoded to 8, the module doesn't support allocating a /60 to a VPC and deriving subnets correctly from it.
Suggestion :
Make the newbits value configurable (defaulting to 8) to support use cases where each VPC only gets a /60 block.

Regards,
MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant