Skip to content

Terraform version managers

tofuenv

tenv

From the maintainer of tenv:

Tenv is also designed not as wrapper, but as an in-depended binary program for managing OpenTofu as well as Terraform.

Tfswitch

Install

Remove any global Terraform binary installations

sudo pacman -R terraform

Then install tfswitch

pamac install tfswitch-bin

Usage

Tfswitch honors the terraform.required_version setting in i.e. versions.tf, and switches to this version. Use i.e. required_version = "~> 1.4.0" to require TF v1.4.x

tfswitch

tfenv

Install and setup

pamac install tfenv
mkdir -p ~/.tfenv/bin
export TFENV_CONFIG_DIR=~/.tfenv

Setup GPG key for signature verification

echo 'trust-tfenv: yes' > ${TFENV_CONFIG_DIR}/use-gpgv
sudo mkdir /opt/tfenv/share
gpg --search-key 374EC75B485913604A831CC7C820C6D5CD27AB87
gpg --armor --export 374EC75B485913604A831CC7C820C6D5CD27AB87 > /tmp/hashicorp-keys.pgp
sudo mv /tmp/hashicorp-keys.pgp /opt/tfenv/share/hashicorp-keys.pgp

tfenv usage

tfenv install 1.6.0

Issues

  • Could not easily set up GPG verification
  • Could not easily install versions as unprivileged user (TFENV_CONFIG_DIR and TFENV_INSTALL_DIR are ignored)