MatthewJohn / terrareg

Open source Terraform module registry with UI, optional Git integration and deep analysis
https://gitlab.dockstudios.co.uk/pub/terrareg
GNU General Public License v3.0
268 stars 20 forks source link

Use tenv instead of tfswitch #42

Open kvendingoldo opened 5 months ago

kvendingoldo commented 5 months ago

Hi, I've noticed that you're using tfswitch for version management. It's sad, but tfswitch does not support OpenTofu. My team created a project tenv that supports Terraform, OpenTofu and Terragrunt in one tool. I suggest to migrate to it, because it allow you to manage everything related to Terraform just by one tool.

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

MatthewJohn commented 3 months ago

Hi @kvendingoldo,

Whilst I appreciate the request, having read through the documentation, I find it somewhat complex. To use a third party tool as part of another application, I need to know exactly what it is going to do:

tfswitch does one job and is quite explicit in how it does it. I would like to get tfswitch to support opentofu, which I'm going to be working on in the background

Matt

kvendingoldo commented 3 months ago

hi @MatthewJohn , thank you for your response. I think that we will cover all of your points in tenv (I will add more clear information about №1, №2 to README.md). Can you also clarify what do you mean about HTTP proxies?

kvendingoldo commented 3 months ago

O, looks like that I see: ["tfswitch", "--mirror", "https://localhost-archive/mirror/terraform", "--bin", f"{os.getcwd()}/bin/terraform"]. tenv can use custom mirror via TFENV_REMOTE / TOFUENV_REMOTE / TG_REMOTE.

dvaumoron commented 3 months ago

tenv <tool> detect may install something depending on TENV_AUTO_INSTALL var. It is possible to use -n flag to disable autoinstall.

The version resolution order is specified, indicating which file will be looked, with the install subcommand, the last thing tried when there is no version file found is the latest behavior, which search the latest stable version.

MatthewJohn commented 3 months ago

Created gitlab issue: https://gitlab.dockstudios.co.uk/pub/terrareg/-/issues/520 gitlab-issue-id:520

MatthewJohn commented 3 months ago

Given that we are adding support for Opentofu to tfswitch (https://github.com/warrensbox/terraform-switcher/pull/435), we are already using tfswitch and tfswitch is somewhat simpler and more directed at what we are trying to achieve with the tool, I'm not sure of the benefit from switching

kvendingoldo commented 3 months ago

Good efforts! If it's not difficult, can you tell us, in which cases tfswitch is simpler? It will help us to make tenv better.