gruntwork-io/terragrunt-action

Add Support for installing OpenTofu instead of Terraform

rstuhlmuller opened this issue ยท 7 comments

Describe the solution you'd like

Add the ability for the terragrunt-action to optionally install and use OpenTofu instead of Terraform. This could be achieved by introducing a new input parameter, e.g., use_opentofu, which when set to true, would trigger the installation and use of OpenTofu instead of Terraform.

Describe alternatives you've considered

  • Create a separate action for OpenTofu: Instead of modifying the existing terragrunt-action, create a new action specifically designed for OpenTofu. This would keep the terragrunt-action focused on Terraform, while providing a separate solution for OpenTofu users.
  • Fork the terragrunt-action: Create a fork of the terragrunt-action repository and modify it to support OpenTofu. This would allow for easier maintenance and updates, but would require users to switch to the forked version.

Additional context

OpenTofu is a drop-in replacement for Terraform, aiming to provide faster and more efficient execution of Terraform configurations. By adding support for OpenTofu in the terragrunt-action, users would have the option to leverage the performance benefits of OpenTofu while still utilizing the existing action and its features.

It's worth noting that introducing OpenTofu support might require additional testing and validation to ensure compatibility with the existing action and its workflows. Additionally, documentation updates would be necessary to guide users on how to enable and use OpenTofu with the action.

It seems inevitable that opentofu's behavior will start to deverge, even if it is only the exact cadence at which bugfixes are released. As the community starts to switch to opentofu, either this action will need to be updated or forked.

Hi, Zach from Gruntwork here. We fully intend to support OpenTofu in terragrunt-action. We'll likely get to it in the next couple of weeks, in the interrim PRs are welcome!

@ZachGoldberg Hi Zach, is the plan to switch from tfenv to tenv to support both tf/tofu going forward?

Hi @jhoblitt -- we're midway through migrating to mise across all Gruntwork repos, I anticipate we'll refactor the dependency installation mechanism in terragrunt-action to follow the same pattern

This is the first I've heard of mise. Its plugin registry links to the asdf opentofu plugin. Is any dev work needed to make mise work with tofu or should it be ready to go?

Mise works with tofu out of the box at this point! We're using it in a number of places, its very elegant/straightforward.

OpenTofu support has been added and released in v2.1.0