Add example on supporting both OpenTofu and Terraform versions to version-constraints.mdx (#2302)

Signed-off-by: Ludovico Magnocavallo <ludo@qix.it>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Oleksandr Levchenkov <ollevche@gmail.com>
This commit is contained in:
Ludovico Magnocavallo 2025-01-24 18:48:11 +01:00 committed by GitHub
parent 1b00b465da
commit e7f130a490
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,3 +93,10 @@ versions do not match inexact operators such as `>=`, `~>`, etc.
- Root modules should use a `~>` constraint to set both a lower and upper bound
on versions for each provider they depend on.
### Supporting both OpenTofu and Terraform Versions
- When configuration needs to be supported by both OpenTofu and Terraform, for example in modules
which need to be consumed by both engines, use a `providers.tofu` file to specify
the OpenTofu version constraint, overriding the constraint defined in `providers.tf`.
[Read more about extension precedence](../../files/#extension-precedence).