Skip to content
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

Closed
brikis98 opened this issue Aug 29, 2023 · 3 comments · Fixed by #1352
Closed

Add OpenTofu support #1333

brikis98 opened this issue Aug 29, 2023 · 3 comments · Fixed by #1352
Assignees
Labels
enhancement New feature or request

Comments

@brikis98
Copy link
Member

brikis98 commented Aug 29, 2023

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 the terraform binary first; if that's not found, then try the tofu 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 is stdout and stderr 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.

@brikis98 brikis98 added the enhancement New feature or request label Aug 29, 2023
@skyzyx
Copy link

skyzyx commented Aug 30, 2023

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:

  1. If there is a bug in OpenTF that does not exist in Terraform (or vice-versa), will bug reports (as they pertain to this project) be treated equally on both platforms?

  2. Will testing be performed with code targeting both platforms?

  3. For OpenTF's potential future "superset" functionality, will that be treated as a first-class citizen?

@brikis98 brikis98 changed the title Add OpenTF support Add OpenToFu support Sep 22, 2023
@brikis98 brikis98 changed the title Add OpenToFu support Add OpenTofu support Sep 22, 2023
@denis256 denis256 self-assigned this Oct 5, 2023
@denis256 denis256 mentioned this issue Oct 5, 2023
4 tasks
@denis256
Copy link
Member

denis256 commented Oct 9, 2023

@kvendingoldo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants