You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I am trying to add another CIDR and subnets to a VPC. Both the VPC and the secondary are made using this module, and both use IPAM to get their IPv4 CIDRs.
I've discovered that the module is retrieving the CIDR block of the existing VPC when creating the aws_vpc_ipv4_cidr_block_association.secondary[0], and not a new one from IPAM:
Therefore, aws_vpc_ipv4_cidr_block_association.secondary[0] is given both a CIDR that has already been allocated and the IPAM pool ID, the latter then gets ignored by Terraform or AWS and the apply fails because of it trying to allocate the already allocated CIDR:
Is this intended behaviour? Is IPAM not meant to be used with this module for secondary CIDR's?
The text was updated successfully, but these errors were encountered:
imaginaryCorn
changed the title
Trying to get IPAM to allocate a CIDR on a secondary subnet only gives it the subnet details from the primary VPC
Trying to get IPAM to Allocate a Secondary CIDR Fails; CIDR Already Allocated to the Primary VPC is Used
Feb 28, 2024
Hello! I am trying to add another CIDR and subnets to a VPC. Both the VPC and the secondary are made using this module, and both use IPAM to get their IPv4 CIDRs.
I've discovered that the module is retrieving the CIDR block of the existing VPC when creating the
aws_vpc_ipv4_cidr_block_association.secondary[0]
, and not a new one from IPAM:The config seems to conditionally use the CIDR of the primary VPC if the
var.cidr_block
is not set and a VPC is not being created, but it does not ignore this if IPAM settings are set: https://github.com/aws-ia/terraform-aws-vpc/blob/main/data.tf#L94C3-L95C78Therefore,
aws_vpc_ipv4_cidr_block_association.secondary[0]
is given both a CIDR that has already been allocated and the IPAM pool ID, the latter then gets ignored by Terraform or AWS and the apply fails because of it trying to allocate the already allocated CIDR:Is this intended behaviour? Is IPAM not meant to be used with this module for secondary CIDR's?
My code with omissions:
The text was updated successfully, but these errors were encountered: