From bc0faecff8fffd5ec506b106a3c047b9afe13c06 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 21 Oct 2025 16:44:47 -0700 Subject: [PATCH] rfc: Minor revision to "Miscellaneous Configuration Settings in Modules" While drafting this RFC originally I had intended to carve out an exception of ignoring required_version arguments in .tf files while continuing to support them in .tofu files, but apparently I lost that detail during some copyediting and so the current draft implies that OpenTofu would continue to use required_version in .tf files unless there's an OpenTofu-specific declaration that takes precedence. This update aims to clarify the proposal's handling of modules that are written only for Terraform without using any OpenTofu-specific mechanisms: in that case, we must just make a best effort to load the module in OpenTofu and let it fail with a more specific error if the module happens to be using language features that OpenTofu does not support, so that loading can succeed when the module is only using the subset of features that are cross-compatible between both systems. Signed-off-by: Martin Atkins --- rfc/20250730-module-misc-settings.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rfc/20250730-module-misc-settings.md b/rfc/20250730-module-misc-settings.md index 89c25dae8d..f04f3086a6 100644 --- a/rfc/20250730-module-misc-settings.md +++ b/rfc/20250730-module-misc-settings.md @@ -117,13 +117,17 @@ recommend that authors create both a `.tf` file and a `.tofu` file of the same basename, and place the Terraform version constraint in the `.tf` file and the OpenTofu constraint in the `.tofu` file. -This document does not propose to change anything about that behavior, so -that all existing uses of that pattern will retain their current meaning. +As part of implementing this proposal, we would _slightly_ change the existing +behavior so that OpenTofu will always completely ignore `required_providers` +settings in `.tf` and `.tf.json` files, assuming that they are intended for +Terraform. OpenTofu will continue to honor `required_providers` arguments +in `.tofu` and `.tofu.json` files, so existing modules already using that +pattern will retain their current meaning. Module authors that wish to support OpenTofu versions prior to the introduction of the `language` block type should continue following the existing pattern. Authors should adopt a `language` block and nested `compatible_with` block -only once the minimum required OpenTofu version is one that supports that +only once the minimum required OpenTofu version is one that supports the new syntax. Authors of broadly-shared modules might prefer to delay adopting the new syntax