-
-
Notifications
You must be signed in to change notification settings - Fork 998
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 #2690
Comments
How about modifying the Fwiw, personally and for my own teams, I'm likely to use an alias, or the |
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:
|
I just updated the issue description with: Note on registry usage
Terragrunt uses go-getter to download modules specified in the Possible solutions:
|
Yup. Until otherwise announced, we should support both platforms equally.
Yes, we should test both platforms.
Probably, but hard to say until we know what that functionality is. I think we'll have to decide on a case by case basis, with input from the community. |
Your response is greatly appreciated. This whole situation has created uncertainty at a time when we could really do without it. My company leverages several open-source and SaaS offerings in the Terraform ecosystem, and I've been reaching out across the ecosystem to understand where everyone is on this topic, and identifying what we need to watch out for. Hoping for the very best from this whole situation, but planning ahead for the absolute worst. |
I've been using the unofficial dev snap OpenTF v1.6.0-dev, but even with |
Describe the solution you'd like
As recently announced, the OpenTofu fork should drop soon. We should make sure that Terragrunt supports it out of the box.
Here's an idea for an initial implementation: anywhere Terragrunt 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
terraform_binary
config or--terragrunt-tfpath
CLI flag orTERRAGRUNT_TFPATH
env var, but those all require extra steps, whereas I'd like OpenTofu to "just work" with Terragrunt.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 Terragrunt 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.Note on registry usage
HashiCorp recently did an update (one that was totally unannounced, BTW) to its Registry terms to say:
Terragrunt uses go-getter to download modules specified in the
source
URL, and it's possible that URL points to the Terraform Registry. For now, Terragrunt only works with Terraform, so that is still inline with the terms. If we add support for OpenTofu, then in theory, anyone using Terragrunt with OpenTofu might be violating the registry terms.Possible solutions:
source
URL andtofu
as the binary, give the user a warning.source
URL andtofu
as the binary, automatically use OpenTofu's registry (coming soon) instead of HashiCorp's.The text was updated successfully, but these errors were encountered: