You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As stated in the title I am unable to install a new version of Terraform when the TFENV_TERRAFORM_VERSION environment variable is set. Terminal session pasted below:
$ tfenv
tfenv 3.0.0
Usage: tfenv <command> [<options>]
...
$ tfenv install 1.10.2
Terraform v1.9.5 is already installed
$ tfenv list
* 1.9.5 (set by TFENV_TERRAFORM_VERSION)
1.6.6
1.5.7
1.5.3
$ unset TFENV_TERRAFORM_VERSION
$ tfenv list
1.9.5
* 1.6.6 (set by /opt/homebrew/Cellar/tfenv/3.0.0/version)
1.5.7
1.5.3
$ tfenv install 1.10.2
Installing Terraform v1.10.2
Downloading release tarball from https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_darwin_arm64.zip
########################################################################################################################################## 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_SHA256SUMS
Not instructed to use Local PGP (/opt/homebrew/Cellar/tfenv/3.0.0/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
Archive: /var/folders/5s/ykr2l85x7ngbd45q1nvtmss40000gn/T/tfenv_download.XXXXXX.mPvCtPOJhA/terraform_1.10.2_darwin_arm64.zip
inflating: /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.10.2/LICENSE.txt
inflating: /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.10.2/terraform
Installation of terraform v1.10.2 successful. To make this your default version, run 'tfenv use 1.10.2'
$ tf version
Terraform v1.10.2
on darwin_arm64
$ tfenv list
* 1.10.2 (set by /opt/homebrew/Cellar/tfenv/3.0.0/version)
1.9.5
1.6.6
1.5.7
1.5.3
The text was updated successfully, but these errors were encountered:
@tjcelaya When you set the TFENV_TERRAFORM_VERSION environment variable, tfenv prioritizes it for determining the active Terraform version. This affects how tfenv processes version resolution and installation.
You can track this by setting TFENV_DEBUG=1 before the installation but essentially when you run tfenv install [<version>]:
tfenv-install would try to resolve the requested version with: tfenv-resolve-version 1.10.2.
tfenv-resolve-version checks for TFENV_TERRAFORM_VERSION to see if you have declared such environment variable and if so, it would pin the requested version to that.
tfenv-resolve-version processes the pinned version and determines whether it is already installed. If the version is found to be installed, the installation process ends here.
So, according to the logic of tfenv-resolve-version, it seems to be expected as tfenv-resolve-version gives precedence to the TFENV_TERRAFORM_VERSION variable.
As stated in the title I am unable to install a new version of Terraform when the TFENV_TERRAFORM_VERSION environment variable is set. Terminal session pasted below:
The text was updated successfully, but these errors were encountered: