-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
I've come across an use case where I want to add a secondary CIDR Block and create new subnets with those blocks. I created my VPC with the module so I want to see if I can leverage it to do that.
With aws_vpc_ipv4_cidr_block_association we can associate new CIDR blocks, so maybe we can accept a list of secondary_cidr_blocks in the module definition and use the length to know how many associations to make.
Now the part I could use some guidance on is how to handle the dependency case. If I'm adding extra CIDR blocks and subnets. I want the vpc created and then the secondary associations created and then everything else created.
I can take care of this if I get some guidance on how to handle the dependency structure of ensuring the VPC is created and then the associations occur. Maybe we can abstract the vpc resource to an inner module that takes the vpc information and the secondary cidr blocks, then the rest of the main file can reference that module.
Anyways, tell me what you think.