terraform-backend-git icon indicating copy to clipboard operation
terraform-backend-git copied to clipboard

Support for OpenTOFU

Open dantefromhell opened this issue 6 months ago • 2 comments

Will this project be able to support OpenTOFU as a replacement for the official TerraForm?

dantefromhell avatar Dec 10 '23 02:12 dantefromhell

I think it is already although I never tested it. Standalone mode doesn't care what makes requests to it, as long as they haven't changed the API for the http backend - it will work. Wrapper mode always had --tf as well as wrapper.tf.bin option to customize path/command it is using. It is meant for things like tfenv but I suppose it should work just fine for opentofu. If opentofu consider pluggable backends support, which Hashicorp been refusing to do for ages, we can make it work even better than it ever could for Hashicorp's Terraform. But I personally making no commitments yet. I am still wondering what the future is for both tf and opentofu and whether it is worth investing any more time into either. In the meantime I am exploring some cool new alternatives such as Crossplane.

dee-kryvenko avatar Dec 10 '23 06:12 dee-kryvenko

At this moment if you need to have a support of Terraform as well as OpenTofu (and Terragrunt :) ) in one tool you can use https://github.com/tofuutils/tenv which my team wrote some months ago. A lot of users switched to that tool to unify version management in the world of Terraform.

You're welcome to open any issues or contribute to tenv.

kvendingoldo avatar Apr 02 '24 22:04 kvendingoldo

I actively use this tool with OpenTofu by simply renaming the tofu binary to terraform.

For example,

mv $(which tofu) /usr/bin/terraform

thehale avatar Apr 17 '24 20:04 thehale

@thehale you can also use --tf or wrapper.tf.bin to give it a path to open tofu. Again, I have not yet tried that myself, but that option existed in the backend long before opentofu.

dee-kryvenko avatar Apr 20 '24 04:04 dee-kryvenko