-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Wrong default tool when both Terraform and OpenTofu are installed? #3172
Comments
Sorry about the confusion! We failed to update our documentation adequately, but this is the expected default behavior of Terragrunt. If both Terraform and OpenTofu are installed on a host, Terragrunt will default to using OpenTofu unless specified otherwise. |
I'm not happy with this change. I do appreciate the effort in supporting and somehow motivating the use of OpenTofu, but making it the default tool is a BREAKING CHANGE. How many issues will you cause to people still using Terraform that will upgrade Terragrunt just to find out their pipelines etc are broken because suddenly the default tool changed? |
@yhakbar The annoying side-effect of the change is that opentofu updates provider URLs in tfstate making them point at opentofu registry, and some of the providers in their registry are signed with keys that cannot be validated by terraform (e.g. |
This also becomes really difficult because (assuming semantic versioning, though this may not be being followed), since the releases are pre-1.0.0, the versioning becomes really difficult to indicate breaking changes. I completely agree that this feels like a breaking change - if a user starts with the expectations that they are using Terraform and suddenly switch to OpenTofu, it feels dangerous. Whist Terraform and OpenTofu were compatible, they even state themselves that they are only compatible up to 1.6 ^1 This means that the 1.7 releases of Terraform/OpenTofu can (and do) have feature divergence. We can see this in the OpenTofu state encryption and the Terraform features implemented in OpenTofu that sparked controversy (and how this may/may not affect future implementation of like-for-like features). I'm not arguing either way that people should use one or the other, nor that one or the other is better (in any means of the word). However, what I am saying is that treating them as the same product and are interchangeable in a patch release is dangerous. ^1 - https://opentofu.org/ - "What are the differences between OpenTofu and Terraform?":
Edit: To be clear, this concern doesn't come from whether, after upgrading, the a pipeline fails or such, it's more that users won't realise, they go 6 months or a year down the line and then they realise they try to use a feature that doesn't work (because it's not in the product that they're actually using), they attempt to switch and the state is incompatible and they end up with a mess of a migration. I'll also definitely end this on: this is still a pre-1.0.0 release and users should pay attention to this fact - so, I guess a plea to terragrunt to release a major version and follow semantic versioning and to users to not ignore the fact that something is pre 1.x.x |
Gruntwork CEO here. First, I'd like to apologize. After reading through your comments, I believe the root issue here is that we made a breaking change but released it as a patch change, leading to a surprise that in fact there was a breaking behavior for some users. This issue proved to be helpful feedback for us, and we created #3178 to address the root cause. One of our guiding mantras for how we build Terragrunt is "do what's best for the Terragrunt community," and this was a situation where we could have done better. As a resolution, we plan to issue a breaking release where the release notes reference the original release that contained switching the default to OpenTofu. This way, all users who study breaking change releases will catch that we made this change earlier. Thanks again for the feedback, and any other suggestions you have either here or on #3178 are welcome! |
Thanks @josh-padnick, Not sure which comment this was directly directly geared at, but from my PoV, that's exactly it, so thank you for this and for creating the issue :) Matt |
Note that the following releases have been retroactively updated into include notices to help users understand the change in default tool for Terragrunt:
We're hoping that the updated notes on the releases will make it clear that additional action has to be taken to make the upgrade to a version > |
I had this exact issue today. I had to step into very dangerous territory requiring me to delete the state files and re-push them. I have explained my steps to fix in this issue thread. |
I was also caught by this problem, and I assumed it was a bug because when I checked the PR adding tofu support it mentions that default behavior will be to use terraform, and fallback to tofu if terraform is not found. https://github.com/gruntwork-io/terragrunt/releases/tag/v0.52.0 |
Thanks for the call out, @kevcube . I've updated the release notes with a note that the behavior changed in the future release of |
Describe the bug
Terragrunt seems to use OpenTofu by default when both Terraform and OpenTofu are installed side-by-side.
Steps To Reproduce
/usr/local/bin/
directory:terragrunt init
orterragrunt plan
using configuration that doesn't useTERRAGRUNT_TFPATH
nor--terragrunt-tfpath
, as mentioned in the Expected behaviour.Expected behavior
As mentioned in v0.52.0 , Terragrunt should use Terraform instead of OpenTofu unless applying one of:
Actual configuration:
Expected configuration:
Nice to haves
Versions
Environment details:
I am installing Terragrunt, OpenTofu and Terraform side-by-side in a Docker image
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: