Closed kurt-mw closed 4 weeks ago
With commit https://github.com/Azure/terraform-azurerm-avm-res-network-virtualnetwork/commit/0b98468937a391b625d32098bc558d3e7c8ef54e in v0.4.0 of the module, a new feature in Terraform 1.9 has been used, "Cross-object referencing for input variable validations".
The use of this feature is also problematic when using OpenTofu, even the latest version, as it's not supported yet (https://github.com/opentofu/opentofu/issues/1336). To test with OpenTofu, because the min ver requirement of the module has been increased to 1.9, but the current latest OpenTofu version is 1.8, I had to provide OpenTofu specific terraform.tofu files as can be seen in commit https://github.com/alefteris/terraform-azurerm-avm-res-network-virtualnetwork/commit/72d01e75662df962d614829ef2d532ff83224280 from my fork. But tofu init
still fails because of the new feature used, supported only by Terraform 1.9. So with another commit (https://github.com/alefteris/terraform-azurerm-avm-res-network-virtualnetwork/commit/0f0a34146a8b3cfdb854893211c046242923fe3d), I removed the unsupported validations. This is far from ideal, as you wont get any errors when not using the spesific variables the correct way.
Hi @kurt-mw
I'm sorry you're having issues with this module. Currently our stance is to leverage terraform as the lead IaC tool for AVM TF.
This means we are reliant on opentofu maintaining its compatibility promises and implementing new features to keep up HashiCorp's version.
This divergence in features is far from ideal and only hurts customers. I hope that it will be resolved soon.
Yes less than ideal, thanks for the response.
@kurt-mw Commenting only to let you know that I have just run into the same issue, but I understand your position.
@kurt-mw and @chopeen Just wanted to share this in case you haven't seen it: https://github.com/Azure/Azure-Verified-Modules/discussions/1512. Also on LI: https://www.linkedin.com/feed/update/urn:li:activity:7250073120919683072/
I'll have to admit it didn't occur to me at the time of adding the validation it would break for OpenTofu. I would consider reverting that change if there is enough demand and OpenTofu support does not come soon.
@jaredfholgate Thanks I hadn't seen that announcement yet, it's good to get a bit of clarity. Variable validation support is coming to OpenTofu, I believe it'll still need some shimming similar to what @alefteris has put into their fork to map the versions. I'm still sitting on the fence with version 1.5.7 but that won't last much longer with new features being utilized in more modules.
Check for previous/existing GitHub issues
Issue Type?
I'm not sure
(Optional) Module Version
No response
(Optional) Correlation Id
No response
Description
The update a few weeks ago bumped the Terraform version from
required_version = ">= 1.5.0"
torequired_version = ">= 1.9.2"
. I have my minimum set to1.5.7
to allow transition to OpenTofu if required and I suspect I wouldn't be the only person to also be in this position.Are there changes that required a bump in the minimum version? What are the expectations going forward with regard to bumping the minimum version?