-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenTofu support #1333
Comments
From a technical perspective, I expect that it will be a no-op for the time being as OpenTF anticipates maintaining compat/interop for the foreseeable future. (However, OpenTF has stated that some functionality may be added to OpenTF that is a superset of what's in base Terraform. [source]) From a process perspective:
|
btw. you can also integrate tenv that support Terraform as well as OpenTofu (and Terragrunt :) ) in one tool. It allow you to simplify version management. |
Describe the solution you'd like
As recently announced, the OpenTofu fork should drop soon. We should make sure that Terratest supports it out of the box.
Here's an idea for an initial implementation: anywhere Terratest calls out to the
terraform
binary, we should update it to check for theterraform
binary first; if that's not found, then try thetofu
binary; and if that's not found, show an error (as we do today). Whatever we pick, we should mention in the debug log.Describe alternatives you've considered
In theory, you can already use OpenTofu by using the
TerraformBinary
config, but that requires extra steps, whereas I'd like OpenTofu to "just work" with Terratest.Additional context
OpenTofu should work as a "drop in" replacement for Terraform, so in theory, no other changes should be necessary. However, we should run our tests to make sure once the
tofu
binary is available for testing. One place where OpenTofu will differ isstdout
andstderr
output will say OpenTofu instead of Terraform; if Terratest is parsing that log output anywhere, we'll need to update the code accordingly.This is just the initial implementation in the sense that it should be backward compatible. In the future, we can reverse the lookup order, and perhaps even drop support for
terraform
, but those would be significant breaking changes (especially the latter), so we'd want to see how things go with OpenTofu and what the community wants first.The text was updated successfully, but these errors were encountered: