It's very difficult to work with aws_vpc_ipv4_cidr_block_association to manage IPv4 CIDR blocks, normally you will be met with conflicting range or CIDR block in use by subnet errors. If you try to grow or merge CIDR blocks, you will be met with conflicting block errors as the individual items aren't ordered in AWS.
Would it be possible to add another function that would take a list of CIDR blocks and that function would take care of deleting older block / modifying the state in AWS? At the moment individuals would need to write something to maintain this list outside terraform if they plan to update CIDRs on any regular cadence.
Affected Resource(s) and/or Data Source(s)
No response
Potential Terraform Configuration
# We start by adding a small CIDR block
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
resource "aws_vpc_ipv4_cidr_block_association" "a_cidr" {
vpc_id = aws_vpc.main.id
cidr_block = "172.20.0.0/16"
}
...
# We want to grow the existing CIDR block and we are greeted by a conflicting block error
resource "aws_vpc_ipv4_cidr_block_association" "a_cidr" {
vpc_id = aws_vpc.main.id
cidr_block = "172.20.0.0/15"
}
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
It's very difficult to work with
aws_vpc_ipv4_cidr_block_association
to manage IPv4 CIDR blocks, normally you will be met with conflicting range or CIDR block in use by subnet errors. If you try to grow or merge CIDR blocks, you will be met with conflicting block errors as the individual items aren't ordered in AWS.Would it be possible to add another function that would take a list of CIDR blocks and that function would take care of deleting older block / modifying the state in AWS? At the moment individuals would need to write something to maintain this list outside terraform if they plan to update CIDRs on any regular cadence.
Affected Resource(s) and/or Data Source(s)
No response
Potential Terraform Configuration
References
No response
Would you like to implement a fix?
None