-
Notifications
You must be signed in to change notification settings - Fork 41
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
Allow "terraform" to be equivalent to "tf" (prefer opentofu, if version file exists) #339
Comments
There is a misunderstanding here, as stated in the sentence at the start of this section, the tool column describe the possibility for That's different from the |
@dvaumoron thank you for the additional context! I will clarify my request then. For personal use in the terminal, I use the Some tools I use that integrate with terraform/opentofu have |
You can rename the binary (the |
Rather than overriding the "terraform" binary by masking it with a symlink to "tf" earlier in my PATH, I would prefer to be able to configure tenv to handle this (imo this should be the default behavior of tenv's My primary concern that makes me prefer this is to avoid confusion with differences in environments such as my local machine vs GitHub Actions vs a compute instance somewhere vs other developers' machines. However, if you as the maintainer think differently about this, and don't want this change implemented in tenv, that's totally fine 👍 |
I will add an env var to switch the terraform proxy behavior to be the agnostic behavior. |
Taken from README:
tofu
(opentofu
)tf
(terraform
)tg
(terragrunt
)at
(atmos
)In my testing, current behavior of the above commands is actually like below:
I ended up investigating this as I had an issue with my neovim setup (specifically, the linting plugin) failing to run tenv managed opentofu. I came across this issue by someone else which made me realise the issue might be because tenv is being called under the name
terraform
: mfussenegger/nvim-lint#726This neovim plugin, as well as tons of other tooling, assume that they will find the tool under the name
terraform
. In my case, it is a lot easier to have tenv replicate the same behavior fortf
when called asterraform
, rather than keep an eye out for this issue for every integration I use and configure them. After all, it is rare for me to want to use both terraform and opentofu on the same project.A global config file or
.tenvrc
or an environment variable (ideally, all of the above) that let me change this behavior would be perfect, however maybe you have thoughts about what's best in the long term to ensure stability for all users while allowing this workflow without requiring shell aliases or shadowing the binary.The text was updated successfully, but these errors were encountered: