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?
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: