Closed supergillis closed 1 year ago
hey, @supergillis! š
please try to do the following in your manifest: user_peer_network_cidrs = toset(var.cidrs)
let me know if the problem persist, thank you!
Just tried it and it's the same thing as using sort
. The CIDR ranges in Terraform are not sorted the same way as in the Aiven platform and every apply tries to reorder the CIDR ranges.
I see, I'll check what could be done about it, thank you
hey, @supergillis! š
we've introduced a fix with #1171, but were unable to fully test it out
I'll prepare a Release Candidate release for you so you can test it out and provide feedback, thank you!
@supergillis please check if v4.4.0-rc1
fixes the problem, thank you!
Seems to work now. Thanks!
you welcome, we will prepare a stable release in the coming days š
What happened?
The
aiven_transit_gateway_vpc_attachment
resource expectsuser_peer_network_cidrs
values to be ordered. If the values are equal but in a different order, then the resource will be updated. This means that the Aiven provider will try to update the resource every time Terraform plan runs.Using the Terraform
sort
function is not possible as Aiven sorts the values of the CIDR range by their numeric value. For example, Aiven sorts CIDRs like this["10.7.192.0/18", "10.227.140.0/23"]
(7 is numerically smaller than 227) but Terraformsort
will sort CIDRs like this["10.227.140.0/23", "10.7.192.0/18"]
(string "227" is smaller than string "7").Complete example:
This results in the following Terraform plan:
I'm using the following workaround right now:
What did you expect to happen?
The
aiven_transit_gateway_vpc_attachment
resource should not updateuser_peer_network_cidrs
if the set of values equals the actual values. It should ignore the order of the values.What else do we need to know?
Aiven provider version: 4.3.0