Apache License 2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

tenv:把版本管理器做成一层透明的运行时调度

项目背景与痛点

Terraform 生态的版本管理一直是个不起眼、却必须处理的问题:Terraform 本身的迭代经常带来破坏性的语法变化和 state 迁移,而 OpenTofu 分叉之后,同一台机器上并存 terraform 与 tofu 成了常态;再往外一圈,Terragrunt、Terramate、Atmos 这些封装层各自有版本节奏,还各自孵化出 tfenv、tgswitch、tfswitch 之类的独立工具。

结果是:开发者机器上装着四五个版本管理器,每个都有自己的版本文件约定、自己的环境变量前缀、自己的安装目录;CI 镜像里 PATH 顺序复杂到没人能说清楚 terraform 最终指向哪里。这不是工具缺失,而是工具碎片化带来的问题。

tofuutils/tenv 的目标很明确:把这堆各自为政的版本管理器合并成一个二进制文件,用一套机制统一处理 OpenTofu、Terraform、Terragrunt、Terramate 和 Atmos 五种工具。它继承了 tofuenv 的工程底子,又把这套逻辑抽象成通用机制。

核心技术揭秘

tenv 用 Go 编写,单一静态二进制,CLI 层基于 Cobra。但它真正的架构重心,是把每个工具抽象成注册表条目,而不是硬编码工具逻辑。

每个工具在注册表里被描述为一组元数据:可执行文件名、版本文件候选名(.opentofu-version、.terraform-version、.terragrunt-version 等)、环境变量前缀、版本来源(GitHub Releases 或 HashiCorp releases API)、校验方式。新增一个工具,本质上只是增加一条元数据,而不是重写一套安装逻辑。这种「数据驱动 + 策略表」的设计,是它能低成本覆盖五个工具的根本原因。

运行时则依赖 shim 与 argv[0] 分派:tenv 把自己的二进制以 tofu、terraform、terragrunt 等名字放进 PATH 前端(Windows 上是同名 .exe)。用户敲下命令时,实际被执行的是 tenv 自己,它通过 argv[0] 判断当前要代理哪个工具,再走版本解析与执行流程。

graph TD A[用户执行 tofu / terraform / terragrunt] --> B[tenv shim 拦截 argv0] B --> C[工具注册表匹配工具元数据] C --> D[版本解析器] D --> E{"环境变量是否指定版本"} E -->|"是"| F[环境变量版本] E -->|"否"| G{"项目版本文件是否存在"} G -->|"是"| H[读取 .opentofu-version 等文件] G -->|"否"| I[回退全局默认版本] F --> J{"本地缓存是否已有该版本"} H --> J I --> J J -->|"已存在"| K[exec 真实二进制] J -->|"缺失"| L[下载 release 与校验和] L --> M[校验 SHA256 与签名] M --> N[原子移动到版本目录] N --> K

版本解析的优先级链条是这类工具的核心语义:环境变量(最高优先级,便于 CI 临时覆盖)> 项目版本文件(随仓库走,保证团队一致)> 全局默认。tenv 在这一层做了大量兼容处理,能识别生态里已经存在的各种版本文件名,这让迁移几乎零成本。

安装路径上最容易被忽视、也最见功力的细节是原子性:下载、校验、解压到一个临时位置,比对 checksum(可选的签名校验),全部通过后才移动到 TOFUENV_ROOT 下的版本目录。任何一步失败,都不会留下一个「看起来存在但不可用」的版本目录——这是很多 shell 脚本版版本管理器长期以来的问题。

功能亮点与差异

对比 tfenv、tgswitch、asdf,tenv 的差异不是「功能更多」,而是语义统一:

  • 一进程多工具:所有工具共享同一套解析、下载、缓存逻辑,tenv tf install、tenv tg list 的子命令形态高度对称,学习成本只付一次。
  • 向后兼容的版本文件:不强迫团队改约定,.terraform-version 照样生效,这意味着可以在不改任何存量仓库的前提下先换工具,再逐步统一。
  • 惰性自动安装:开启 auto-install 后,首次调用某个未安装版本时会自动下载,减少「版本文件改了但机器没装」这类高频故障。
  • 可验证的供应链:校验和是默认动作,签名校验作为可选强化手段,对需要审计的团队是加分项。

应用场景与落地建议

最适合的场景是 monorepo 与多栈团队:一个仓库里既有 Terraform 模块、又有 Terragrunt 环境编排,还可能试点 OpenTofu,tenv 可以把版本声明收敛到版本文件里,让「版本」变成代码资产而不是口头约定。

生产落地需要注意几点:

  1. PATH 顺序必须可控。shim 生效的前提是 tenv 目录排在真实二进制之前;CI 镜像里若同时装了系统包版本的 terraform,很容易绕过 shim。
  2. 自动安装意味着隐式网络依赖。在离线或限网环境应改为中心化预热缓存目录,或直接关闭自动安装,让缺失版本显式失败。
  3. 版本文件要进仓库、要 review。工具把便利性给了你,但「升不升级」这个决策仍然需要人来负责。
  4. Windows 与 WSL 双环境要分别验证 shim 行为,跨文件系统的缓存目录容易踩坑。

综合评价

优点:架构干净,工具抽象做得到位;单二进制、无运行时依赖,分发极简;对存量版本文件兼容到位,迁移摩擦很低;安装流程的原子性和校验意识明显强于脚本派同类工具。

缺点:shim 机制天然对 PATH 敏感,排障时容易出现「明明装了却用不上」的困惑,诊断命令虽能缓解,但心智负担依然存在;多工具注册表带来一定配置复杂度,只用单一工具的团队会觉得它比 tfenv 略重;新工具支持依赖上游 release 格式,适配新成员需要贡献代码,并非开箱即得。

一句话:如果你只用一个版本的 Terraform,它可能有点大材小用;但只要你手上不止一种 IaC 工具、不止一个版本,tenv 就是目前这个生态里工程完成度最高的统一选择。

README

Github release Contributors maintenance status Go report codecov


Logo

tenv

OpenTofu, Terraform, Terragrunt, Terramate and Atmos version manager, written in Go.
· Report Bug · Request Feature ·

DevHunt - Tool of the Week

About The Project

Welcome to tenv, a versatile version manager for OpenTofu, Terraform, Terragrunt, Terramate and Atmos, written in Go. Our tool simplifies the complexity of handling different versions of these powerful tools, ensuring developers and DevOps professionals can focus on what matters most - building and deploying efficiently.

tenv is a successor of tofuenv and tfenv.

Key Features

Difference with asdf

asdf-vm share the same goals than tenv : simplify the usage of several version of tools.

asdf-vm is generic and extensible with a plugin system, key tenv differences :

  • tenv is more specific and has features dedicated to OpenTofu, Terraform, Terragrunt, Terramate and Atmos, like HCL parsing based detection (see Key Features).
  • tenv is distributed as independent binaries and does not rely on any shell or other CLI executable.
  • tenv does better in terms of performance and platform compatibility. It works uniformly across all modern operating systems, including Linux, MacOS, Windows, BSD, and Solaris, whereas asdf-vm natively supports only Linux and MacOS.
  • tenv checks the sha256 checksum and the signature of the checksum file with cosign. Check Signature support section for getting more information about it.
  • tenv command compatibility: In nearly all places you can use the exact syntax that works in tfenv / tofuenv. If you’re coming from tfenv/tofuenv and comfortable with that way of working you can almost always use the same syntax with tenv.
  • tenv performance: It sounds incredibly useful, though it might be tough to get a real apples to apples comparison since the tools work differently in a lot of ways. The author of asdf did a great writeup of performance problems.

Table of Contents

Table of Contents
  1. About The Project
  2. Table of contents
  3. Getting Started
  4. Usage
  5. Environment variables
  6. Version files
  7. Troubleshooting
  8. Technical details
  9. Verifying tenv Signatures
  10. Contributing
  11. Community
  12. Authors
  13. Licence

Getting Started

Prerequisites

If you need to enable cosign checks, install cosign (v.2.0+) tool via one of the following commands:

MacOS (Homebrew, MacPorts)

Installation via Homebrew:

brew install cosign

Installation via MacPorts:

sudo port install cosign
Windows (go install)
go install github.com/sigstore/cosign/v2/cmd/cosign@latest
Alpine Linux
apk add cosign
Arch Linux
sudo pacman -S cosign
Gentoo (Portage)
emerge --ask app-containers/cosign
Linux: RPM
LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v")
curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign-${LATEST_VERSION}-1.x86_64.rpm"
sudo rpm -ivh cosign-${LATEST_VERSION}-1.x86_64.rpm
Linux: dkpg
LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v")
curl -O -L "https://github.com/sigstore/cosign/releases/latest/download/cosign_${LATEST_VERSION}_amd64.deb"
sudo dpkg -i cosign_${LATEST_VERSION}_amd64.deb

Installation

Automatic Installation
Arch Linux (AUR, Nix)

This package is available on the Arch Linux User Repository. It can be installed using the yay AUR helper:

yay tenv-bin

Installation via Nix package manager:

nix-env -i tenv
MacOS (Homebrew, MacPorts, Nix)

Installation via Homebrew:

brew install tenv

Installation via MacPorts:

sudo port install tenv

Installation via Nix package manager:

nix-env -i tenv
Windows (Chocolatey, Scoop etc.)

Installation via Chocolatey:

choco install tenv

Installation via Scoop:

scoop install tenv

Installation via Nix package manager:

nix-env -i tenv

Installation via WinGet package manager:

winget install Tofuutils.Tenv
Linux: Snapcraft
snap install tenv
Alpine
apk add tenv --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
Installation via Cloudsmith Artifact Management platform.

Setup Cloudsmith repository automatically:

sudo apk add --no-cache bash
curl -1sLf 'https://dl.cloudsmith.io/public/tofuutils/tenv/cfg/setup/bash.alpine.sh' | sudo bash

Install via apk:

apk add tenv
Ubuntu
Install via dpkg
LATEST_VERSION=$(curl --silent https://api.github.com/repos/tofuutils/tenv/releases/latest | jq -r .tag_name)
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_amd64.deb"
sudo dpkg -i "tenv_${LATEST_VERSION}_amd64.deb"
Install via Nix

Installation via Nix package manager:

nix-env -i tenv
Installation via Cloudsmith Artifact Management platform.

Setup Cloudsmith repository automatically:

curl -1sLf 'https://dl.cloudsmith.io/public/tofuutils/tenv/cfg/setup/bash.deb.sh' | sudo bash

Install via apt:

sudo apt install tenv
RedHat
Installation via Cloudsmith Artifact Management platform.

Setup Cloudsmith repository automatically:

curl -1sLf 'https://dl.cloudsmith.io/public/tofuutils/tenv/cfg/setup/bash.rpm.sh' | sudo bash

Install via yum:

sudo yum install tenv
NixOS
nix-env
nix-env -iA nixos.tenv
NixOS Configuration

Add the following Nix code to your NixOS Configuration, usually located in /etc/nixos/configuration.nix

environment.systemPackages = [
    pkgs.tenv
  ];
nix-shell
nix-shell -p tenv
Gentoo (Portage)

tenv is not yet packaged in the official Gentoo repository or in the GURU community overlay, so install the binaries from the release archive:

TENV_VERSION=$(curl --silent https://api.github.com/repos/tofuutils/tenv/releases/latest | jq -r .tag_name)
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${TENV_VERSION}_Linux_x86_64.tar.gz"
tar -xzf "tenv_${TENV_VERSION}_Linux_x86_64.tar.gz"
sudo install -m 0755 tenv tf tofu terraform terragrunt terramate atmos -t /usr/local/bin

On Gentoo, Portage manages a single system version of Terraform (app-admin/terraform): tenv complements it by managing multiple OpenTofu, Terraform, Terragrunt, Terramate and Atmos versions per project in the TENV_ROOT directory (~/.tenv by default).

Manual Installation

Get the most recent packaged binaries (.deb, .rpm, .apk, pkg.tar.zst , .zip or .tar.gz format) by visiting the release page. After downloading, unzip the folder and seamlessly integrate it into your system’s PATH.

Docker Installation

You can use dockerized version of tenv via the following command:

docker run -it --rm tofuutils/tenv:latest help

The docker container is not meant as a way to run tenv for CI pipelines, for local use, you should use one of the packaged binaries.

Install shell completion

Note 注意

If you install tenv via Brew, MacPorts, or Nix, completion will be installed automatically.

zsh
tenv completion zsh > ~/.tenv.completion.zsh
echo "source \$HOME/.tenv.completion.zsh" >> ~/.zshrc
Oh My Zsh
tenv completion zsh > ~/.oh-my-zsh/completions/_tenv

Make sure the completions folder ~/.oh-my-zsh/completions is listed under $fpath:

print -l $fpath
powershell
tenv completion powershell | Out-String | Invoke-Expression
bash
tenv completion bash > ~/.tenv.completion.bash
echo "source \$HOME/.tenv.completion.bash" >> ~/.bashrc
fish
tenv completion fish > ~/.tenv.completion.fish
echo "source \$HOME/.tenv.completion.fish" >> ~/.config/fish/config.fish

Usage

tenv supports OpenTofu, Terraform, Terragrunt, Terramate and Atmos. To manage each binary you can use tenv <tool> <command>. Below is a list of tools and commands that use actual subcommands:

tool (alias) env vars description
tofu (opentofu) TOFUENV_ OpenTofu
tf (terraform) TFENV_ Terraform
tg (terragrunt) TG_ Terragrunt
tm (terramate) TM_ Terramate
at (atmos) ATMOS_ Atmos

Without subcommand tenv display interactive menus to manage tools and their versions.

tenv interactive

tenv <tool> install [version]

Install a requested version of the tool (into TENV_ROOT directory from <TOOL>_REMOTE url).

Without a parameter, the version to use is resolved automatically (see resolution order in tools description, with latest as default in place of latest-allowed).

If a parameter is passed, available options include:

  • an exact Semver 2.0.0 version string to install.
  • a version constraint string (checked against versions available at <TOOL>_REMOTE url).
  • latest, latest-stable (old name of latest) or latest-pre (include unstable version), which are checked against versions available at <TOOL>_REMOTE url.
  • latest:<re> or min:<re> to get first version matching with <re> as a regexp after a descending or ascending version sort.
  • latest-allowed or min-required to scan your IAC files to detect which version is maximally allowed or minimally required. See required_version docs.
tenv tofu install
tenv tofu install 1.6.0-beta5
tenv tf install "~> 1.6.0"
tenv tf install latest-pre
tenv tg install latest
tenv tg install latest-stable
tenv atmos install "~> 1.70"
tenv atmos install latest
tenv <tool> install latest-allowed
tenv <tool> install min-required

A complete display :

$ tenv tofu install 1.6.0
Installing OpenTofu 1.6.0
Fetching release information from https://api.github.com/repos/opentofu/opentofu/releases/tags/v1.6.0
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_linux_amd64.zip
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS.sig
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS.pem
Installation of OpenTofu 1.6.0 successful
tenv <tool> use <version>

Switch the default tool version to use (set in TENV_ROOT/<TOOL>/version file).

tenv <tool> use has a --working-dir, -w flag to write a version file in working directory.

Available parameter options:

  • an exact Semver 2.0.0 version string to use.
  • a version constraint string (checked against versions available in TENV_ROOT directory).
  • latest, latest-stable (old name of latest) or latest-pre (include unstable version), which are checked against versions available in TENV_ROOT directory.
  • latest:<re> or min:<re> to get first version matching with <re> as a regexp after a descending or ascending version sort.
  • latest-allowed or min-required to scan your IAC files to detect which version is maximally allowed or minimally required. See required_version docs.
tenv tofu use v1.6.0-beta5
tenv tf use min-required
tenv tg use latest
tenv atmos use latest
tenv tofu use latest-allowed
tenv <tool> detect

Detect the used version of tool for the working directory.

$ tenv tofu detect
No version files found for OpenTofu, fallback to latest-allowed strategy
Scan project to find .tf files
No OpenTofu version requirement found in project files, fallback to latest strategy
Found compatible version installed locally : 1.6.1
OpenTofu 1.6.1 will be run from this directory.
$ tenv tg detect -q
Terragrunt 0.55.1 will be run from this directory.
$ tenv atmos detect -q
Atmos 1.72.0 will be run from this directory.
tenv <tool> reset

Reset used version of tool (remove TENV_ROOT/<TOOL>/version file).

$ tenv tofu reset
Removed /home/dvaumoron/.tenv/OpenTofu/version
tenv <tool> uninstall [version]

Uninstall versions of the tool (remove it from TENV_ROOT directory).

Without parameter, display an interactive list to select several versions.

If a parameter is passed, available parameter options:

  • an exact Semver 2.0.0 version string to remove (no confirmation required)
  • a version constraint string
  • all
  • but-last (all versions except the highest installed)
  • not-used-for:<duration>, <duration> in days or months, like “14d” or “2m”
  • not-used-since:<date>, <date> format is YYYY-MM-DD, like “2024-06-30”
$ tenv tofu uninstall v1.6.0-alpha4
Uninstallation of OpenTofu 1.6.0-alpha4 successful (directory /home/dvaumoron/.tenv/OpenTofu/1.6.0-alpha4 removed)
tenv <tool> list

List installed tool versions (located in TENV_ROOT directory), sorted in ascending version order.

tenv <tool> list has a --descending, -d flag to sort in descending order.

$ tenv tofu list -v
* 1.6.0 (set by /home/dvaumoron/.tenv/OpenTofu/version)
  1.6.1
found 2 OpenTofu version(s) managed by tenv.
tenv <tool> list-remote

List installable tool versions (from <TOOL>_REMOTE url), sorted in ascending version order.

tenv <tool> list-remote has a --descending, -d flag to sort in descending order.

tenv <tool> list-remote has a --stable, -s flag to display only stable version.

$ tenv tofu list-remote
Fetching all releases information from https://api.github.com/repos/opentofu/opentofu/releases
1.6.0-alpha1
1.6.0-alpha2
1.6.0-alpha3
1.6.0-alpha4
1.6.0-alpha5
1.6.0-beta1
1.6.0-beta2
1.6.0-beta3
1.6.0-beta4
1.6.0-beta5
1.6.0-rc1
1.6.0 (installed)
1.6.1 (installed)
tenv <tool> constraint [expression]

Set or reset a default constraint expression for the tool.

$ tenv tf constraint "<= 1.5.7"
Written <= 1.5.7 in /home/dvaumoron/.tenv/Terraform/constraint

Or without expression :

$ tenv tg constraint
Removed /home/dvaumoron/.tenv/Terragrunt/constraint
tenv help [command]

Help about any command.

You can use --help -h flag instead.

$ tenv help tf detect
Display Terraform current version.

Usage:
  tenv tf detect [flags]

Flags:
  -a, --arch string          specify arch for binaries downloading (default "amd64")
  -f, --force-remote         force search on versions available at TFENV_REMOTE url
  -h, --help                 help for detect
  -k, --key-file string      local path to PGP public key file (replace check against remote one)
  -n, --no-install           disable installation of missing version
  -c, --remote-conf string   path to remote configuration file (advanced settings)
  -u, --remote-url string    remote url to install from

Global Flags:
  -q, --quiet              no unnecessary output (and no log)
  -r, --root-path string   local path to install versions of OpenTofu, Terraform and Terragrunt (default "/home/dvaumoron/.tenv")
  -v, --verbose            verbose output (and set log level to Trace)
$ tenv tofu use -h
Switch the default OpenTofu version to use (set in TENV_ROOT/OpenTofu/version file)

Available parameter options:
- an exact Semver 2.0.0 version string to use
- a version constraint expression (checked against version available in TENV_ROOT directory)
- latest, latest-stable or latest-pre (checked against version available in TENV_ROOT directory)
- latest-allowed or min-required to scan your OpenTofu files to detect which version is maximally allowed or minimally required.

Usage:
  tenv tofu use version [flags]

Flags:
  -a, --arch string           specify arch for binaries downloading (default "amd64")
  -f, --force-remote          force search on versions available at TOFUENV_REMOTE url
  -t, --github-token string   GitHub token (increases GitHub REST API rate limits)
  -h, --help                  help for use
  -k, --key-file string       local path to PGP public key file (replace check against remote one)
  -n, --no-install            disable installation of missing version
  -c, --remote-conf string    path to remote configuration file (advanced settings)
  -u, --remote-url string     remote url to install from
  -w, --working-dir           create .opentofu-version file in working directory

Global Flags:
  -q, --quiet              no unnecessary output (and no log)
  -r, --root-path string   local path to install versions of OpenTofu, Terraform and Terragrunt (default "/home/dvaumoron/.tenv")
  -v, --verbose            verbose output (and set log level to Trace)
tenv update-path

Display PATH updated with tenv directory location first. With GITHUB_ACTIONS set to true, write tenv directory location to GITHUB_PATH.

This command can be used when one of the managed tool is already installed on your system and hide the corresponding proxy (in that case which tenv and which <tool> will indicate different locations). The following shell call should resolve such issues :

export PATH=$(tenv update-path)
tenv version

Display tenv current version.

$ tenv version
tenv version v1.7.0

Environment variables

tenv commands support global environment variables and variables by tool for : OpenTofu, Terraform, TerraGrunt and Atmos.

Global tenv environment variables

TENV_ARCH

String (Default: current tenv binaries architecture)

Allow to override the default architecture for binaries downloading during installation.

tenv <tool> subcommands detect, install and use support a --arch, -a flag version.

TENV_AUTO_INSTALL

String (Default: false)

If set to true tenv will automatically install missing tool versions needed.

tenv <tool> subcommands detect and use support a --install, -i enabling flag, and a --no-install, -n disabling flag.

TENV_FORCE_REMOTE

String (Default: false)

If set to true tenv detection of needed version will skip local check and verify compatibility on remote list.

tenv <tool> subcommands detect and use support a --force-remote, -f flag version.

TENV_GITHUB_TOKEN

String (Default: “”)

Allow to specify a GitHub token to increase GitHub Rate limits for the REST API. Useful because OpenTofu, Terragrunt and Atmos binaries are downloaded from GitHub repository.

tenv tofu and tenv tg subcommands detect, install, list-remote and use support a --github-token, -t flag version.

TENV_GITHUB_APP_ID

String (Default: “”)

The numeric ID of a GitHub App. When set (and TENV_GITHUB_TOKEN is not), tenv generates a short-lived installation access token from the App credentials and uses it as the bearer token for GitHub API calls. This is useful in CI systems (e.g. Atlantis) that already authenticate via a GitHub App, and raises the rate limit to 15,000 requests/hour per installation. Requires one of TENV_GITHUB_APP_PEM or TENV_GITHUB_APP_PEM_FILE to also be set.

TENV_GITHUB_APP_INSTALLATION_ID

String (Default: “”)

The numeric installation ID of the GitHub App. Optional: when omitted, tenv auto-discovers it by querying the App’s installations with the App JWT and using the first one returned. Set it explicitly when the App has more than one installation. Only used when TENV_GITHUB_APP_ID is set.

TENV_GITHUB_APP_PEM

String (Default: “”)

The GitHub App’s RSA private key as an inline PEM string. Alternative to TENV_GITHUB_APP_PEM_FILE; takes precedence over it when both are set. Only used when TENV_GITHUB_APP_ID is set.

TENV_GITHUB_APP_PEM_FILE

String (Default: “”)

Path to a file containing the GitHub App’s RSA private key in PEM format. Alternative to TENV_GITHUB_APP_PEM. Only used when TENV_GITHUB_APP_ID is set.

TENV_QUIET

String (Default: false)

If set to true tenv disable unnecessary output (including log level forced to off).

tenv subcommands support a --quiet, -q flag version.

TENV_LOG

String (Default: “warn”)

Set tenv log level (possibilities sorted by decreasing verbosity : “trace”, “debug”, “info”, “warn”, “error”, “off”).

tenv support a --verbose, -v flag which set log level to “trace”.

TENV_REMOTE_CONF

String (Default: ${TENV_ROOT}/remote.yaml)

The path to a yaml file for advanced remote configuration (can be used to call artifact mirror).

tenv <tool> subcommands detect, install, list-remote and use support a --remote-conf, -c flag version.

TENV_ROOT

String (Default: ${HOME}/.tenv)

The path to a directory where the local OpenTofu versions, Terraform versions, Terragrunt versions and tenv configuration files exist.

tenv support a --root-path, -r flag version.

TENV_SKIP_LAST_USE

String (Default: false)

If set to true tenv disable tracking of last use date for installed versions. It allow to avoid warning message when tenv is installed as root user and run with a normal user by skipping the writing of last-use.txt. This will lead to misselection with not-used-for and not-used-since behavior of tenv uninstall.

TENV_VALIDATION

String (Default: signature)

Set tenv validation, known values are “signature” (check SHA256 and its signature, see signature support), “sha” (only check SHA256), “none” (no validation).

GITHUB_ACTIONS

String (Default: false)

If set to true tenv proxies exposes proxied output stdout, stderr, and exitcode by writing them into GITHUB_OUTPUT in multiline format. GitHub Actions set it (see default environment variables).

GITHUB_OUTPUT

String (Default: “”)

Needed when GITHUB_ACTIONS is set to true, path to a file to write proxied output.

GITHUB_PATH

String (Default: “”)

Used by tenv update-path when GITHUB_ACTIONS is set to true, path to a file to write tenv directory location.

OpenTofu environment variables

TOFUENV_AGNOSTIC_PROXY

String (Default: false)

Switch tofu proxy to an agnostic proxy (behave like tf, see resolution order).

TOFUENV_ARCH

Same as TENV_ARCH (compatibility with tofuenv).

TOFUENV_AUTO_INSTALL

Same as TENV_AUTO_INSTALL (compatibility with tofuenv).

Example 1

Use OpenTofu version 1.6.1 that is not installed, and auto installation stay disabled :

$ tenv use 1.6.1
Written 1.6.1 in /home/dvaumoron/.tenv/OpenTofu/version
Example 2

Use OpenTofu version 1.6.0 that is not installed, and auto installation is enabled :

$ TOFUENV_AUTO_INSTALL=true tenv tofu use 1.6.0
Installing OpenTofu 1.6.0
Fetching release information from https://api.github.com/repos/opentofu/opentofu/releases/tags/v1.6.0
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_linux_amd64.zip
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS.sig
Downloading https://github.com/opentofu/opentofu/releases/download/v1.6.0/tofu_1.6.0_SHA256SUMS.pem
Installation of OpenTofu 1.6.0 successful
Written 1.6.0 in /home/dvaumoron/.tenv/OpenTofu/version
TOFUENV_FORCE_REMOTE

Same as TENV_FORCE_REMOTE.

TOFUENV_INSTALL_MODE

String (the default depend on TOFUENV_REMOTE, without change on it, it is “api” else it is “direct”)

  • “api” install mode retrieve download url of OpenTofu from Github REST API (TOFUENV_REMOTE must comply with it).
  • “direct” install mode generate download url of OpenTofu based on TOFUENV_REMOTE.
  • “mirror” install mode generate download url with TOFUENV_URL_TEMPLATE (as specified in TofuDL mirror specification)

See advanced remote configuration for more details.

TOFUENV_LIST_MODE

String (the default depend on TOFUENV_LIST_URL, without change on it, it is “api” else it is “html”)

  • “api” list mode retrieve information of OpenTofu releases from Github REST API (TOFUENV_LIST_URL must comply with it).
  • “html” list mode extract information of OpenTofu releases from parsing an html page at TOFUENV_LIST_URL.
  • “mirror” list mode retrieve information of OpenTofu releases at TOFUENV_LIST_URL as TofuDL Mirroring format

See advanced remote configuration for more details.

TOFUENV_LIST_URL

String (Default: copy TOFUENV_REMOTE, default is overloaded by “https://get.opentofu.org/tofu/api.json” when TOFUENV_LIST_MODE is “mirror”)

Allow to override the remote url only for the releases listing.

See advanced remote configuration for more details.

TOFUENV_OPENTOFU_PGP_KEY

String (Default: “”)

Allow to specify a local file path or URL to OpenTofu PGP public key. If a URL is provided (starting with “http://” or “https://”), the key will be downloaded from that URL. If a local file path is provided, the key will be read from that location. If not set, the key will be downloaded from the default URL (https://get.opentofu.org/opentofu.asc).

tenv tofu subcommands detect, ìnstall and use support a --key-file, -k flag version.

TOFUENV_REMOTE

String (Default: https://api.github.com/repos/opentofu/opentofu/releases)

URL to install OpenTofu, when TOFUENV_REMOTE differ from its default value, TOFUENV_INSTALL_MODE is set to “direct” and TOFUENV_LIST_MODE is set to “html” (assume an artifact proxy usage).

tenv tofu subcommands detect, install, list-remote and use support a --remote-url, -u flag version.

See advanced remote configuration for more details.

TOFUENV_REMOTE_PASSWORD

String (Default: “”)

Could be used with TOFUENV_REMOTE_USER to specify HTTP basic auth when same credential are used with TOFUENV_REMOTE and TOFUENV_LIST_URL (instead of https://user:[email protected] URL format).

TOFUENV_REMOTE_USER

String (Default: “”)

Could be used with TOFUENV_REMOTE_PASSWORD to specify HTTP basic auth when same credential are used with TOFUENV_REMOTE and TOFUENV_LIST_URL (instead of https://user:[email protected] URL format).

TOFUENV_ROOT

Same as TENV_ROOT (compatibility with tofuenv).

TOFUENV_URL_TEMPLATE

String (Default: https://github.com/opentofu/opentofu/releases/download/v{{ .Version }}/{{ .Artifact }})

Used when TOFUENV_INSTALL_MODE is “mirror” (see TofuDL mirror specification).

TOFUENV_GITHUB_TOKEN

Same as TENV_GITHUB_TOKEN (compatibility with tofuenv).

TOFUENV_TOFU_DEFAULT_CONSTRAINT

String (Default: “”)

If not empty string, this variable overrides OpenTofu default constraint, specified in ${TENV_ROOT}/OpenTofu/constraint file.

TOFUENV_TOFU_DEFAULT_VERSION

String (Default: “”)

If not empty string, this variable overrides OpenTofu fallback version, specified in ${TENV_ROOT}/OpenTofu/version file.

TOFUENV_TOFU_VERSION

String (Default: “”)

If not empty string, this variable overrides OpenTofu version, specified in .opentofu-version files.

tenv tofu subcommands install and detect also respects this variable.

e.g. with :

$ tofu version
OpenTofu v1.6.1
on linux_amd64

then :

$ TOFUENV_TOFU_VERSION=1.6.0 tofu version
OpenTofu v1.6.0
on linux_amd64

Terraform environment variables

TFENV_AGNOSTIC_PROXY

String (Default: false)

Switch terraform proxy to an agnostic proxy (behave like tf, see resolution order).

TFENV_ARCH

Same as TENV_ARCH (compatibility with tfenv).

TFENV_AUTO_INSTALL

Same as TENV_AUTO_INSTALL (compatibility with tfenv).

TFENV_FORCE_REMOTE

Same as TENV_FORCE_REMOTE.

TFENV_HASHICORP_PGP_KEY

Allow to specify a local file path or URL to Hashicorp PGP public key. If a URL is provided (starting with “http://” or “https://”), the key will be downloaded from that URL. If a local file path is provided, the key will be read from that location. If not set, the key will be downloaded from the default URL (https://www.hashicorp.com/.well-known/pgp-key.txt).

tenv tf subcommands detect, ìnstall and use support a --key-file, -k flag version.

TFENV_INSTALL_MODE

String (Default: “api”)

  • “api” install mode retrieve download url of Terraform from Hashicorp Release API (TFENV_REMOTE must comply with it).
  • “direct” install mode generate download url of Terraform based on TFENV_REMOTE.

See advanced remote configuration for more details.

TFENV_LIST_MODE

String (the default depend on TFENV_LIST_URL, without change on it, it is “api” else it is “html”)

  • “api” list mode retrieve information of Terraform releases from Hashicorp Release API (TFENV_LIST_URL must comply with it).
  • “html” list mode extract information of Terraform releases from parsing an html page in TFENV_LIST_URL.

See advanced remote configuration for more details.

TFENV_LIST_URL

String (Default: copy TFENV_REMOTE)

Allow to override the remote url only for the releases listing.

See advanced remote configuration for more details.

TFENV_REMOTE

String (Default: https://releases.hashicorp.com)

URL to install Terraform, changing it assume an artifact proxy use (TFENV_LIST_URL copy it, and if it differ from its default value, TFENV_LIST_MODE is set to “html”, because an artifact proxy usage will not disturb the retrieving of index.json for a release, but will freeze the json list of releases).

tenv tf subcommands detect, install, list-remote and use support a --remote-url, -u flag version.

See advanced remote configuration for more details.

TFENV_REMOTE_PASSWORD

String (Default: “”)

Could be used with TFENV_REMOTE_USER to specify HTTP basic auth when same credential are used with TFENV_REMOTE and TFENV_LIST_URL (instead of https://user:[email protected] URL format).

TFENV_REMOTE_USER

String (Default: “”)

Could be used with TFENV_REMOTE_PASSWORD to specify HTTP basic auth when same credential are used with TFENV_REMOTE and TFENV_LIST_URL (instead of https://user:[email protected] URL format).

TFENV_ROOT

Same as TENV_ROOT (compatibility with tfenv).

TFENV_TERRAFORM_DEFAULT_CONSTRAINT

String (Default: “”)

If not empty string, this variable overrides Terraform default constraint, specified in ${TENV_ROOT}/Terraform/constraint file.

TFENV_TERRAFORM_DEFAULT_VERSION

String (Default: “”)

If not empty string, this variable overrides Terraform fallback version, specified in ${TENV_ROOT}/Terraform/version file.

TFENV_TERRAFORM_VERSION

String (Default: “”)

If not empty string, this variable overrides Terraform version, specified in .terraform-version files.

tenv tf subcommands install and detect also respects this variable.

e.g. with :

$ terraform version
Terraform v1.7.2
on linux_amd64

then :

$ TFENV_TERRAFORM_VERSION=1.7.0 terraform version
Terraform v1.7.0
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.7.2. You can update by downloading from https://www.terraform.io/downloads.html

Terragrunt environment variables

TG_INSTALL_MODE

String (the default depend on TG_REMOTE, without change on it, it is “api” else it is “direct”)

  • “api” install mode retrieve download url of Terragrunt from Github REST API (TG_REMOTE must comply with it).
  • “direct” install mode generate download url of Terragrunt based on TG_REMOTE.

See advanced remote configuration for more details.

TG_LIST_MODE

String (the default depend on TG_LIST_URL, without change on it, it is “api” else it is “html”)

  • “api” list mode retrieve information of Terragrunt releases from Github REST API (TG_LIST_URL must comply with it).
  • “html” list mode extract information of Terragrunt releases from parsing an html page in TG_LIST_URL.

See advanced remote configuration for more details.

TG_LIST_URL

String (Default: copy TG_REMOTE)

Allow to override the remote url only for the releases listing.

See advanced remote configuration for more details.

TG_REMOTE

String (Default: https://api.github.com/repos/gruntwork-io/terragrunt/releases)

URL to install Terragrunt, when TG_REMOTE differ from its default value, TG_INSTALL_MODE is set to “direct” and TG_LIST_MODE is set to “html” (assume an artifact proxy usage).

tenv tg subcommands detect, install, list-remote and use support a --remote-url, -u flag version.

See advanced remote configuration for more details.

TG_REMOTE_PASSWORD

String (Default: “”)

Could be used with TG_REMOTE_USER to specify HTTP basic auth when same credential are used with TG_REMOTE and TG_LIST_URL (instead of https://user:[email protected] URL format).

TG_REMOTE_USER

String (Default: “”)

Could be used with TG_REMOTE_PASSWORD to specify HTTP basic auth when same credential are used with TG_REMOTE and TG_LIST_URL (instead of https://user:[email protected] URL format).

TG_DEFAULT_CONSTRAINT

String (Default: “”)

If not empty string, this variable overrides Terragrunt default constraint, specified in ${TENV_ROOT}/Terragrunt/constraint file.

TG_DEFAULT_VERSION

String (Default: “”)

If not empty string, this variable overrides Terragrunt fallback version, specified in ${TENV_ROOT}/Terragrunt/version file.

TG_VERSION

String (Default: “”)

If not empty string, this variable overrides Terragrunt version, specified in .terragrunt-version files.

tenv tg subcommands install and detect also respects this variable.

e.g. with :

$ terragrunt -v
terragrunt version v0.55.1

then :

$ TG_VERSION=0.54.1 terragrunt -v
terragrunt version v0.54.1

Terramate environment variables

TM_INSTALL_MODE

String (the default depend on TM_REMOTE, without change on it, it is “api” else it is “direct”)

  • “api” install mode retrieve download url of Terramate from Github REST API (TM_REMOTE must comply with it).
  • “direct” install mode generate download url of Terramate based on TM_REMOTE.

See advanced remote configuration for more details.

TM_LIST_MODE

String (the default depend on TM_LIST_URL, without change on it, it is “api” else it is “html”)

  • “api” list mode retrieve information of Terramate releases from Github REST API (TM_LIST_URL must comply with it).
  • “html” list mode extract information of Terramate releases from parsing an html page in TM_LIST_URL.

See advanced remote configuration for more details.

TM_LIST_URL

String (Default: copy TM_REMOTE)

Allow to override the remote url only for the releases listing.

See advanced remote configuration for more details.

TM_REMOTE

String (Default: https://api.github.com/repos/terramate-io/terramate/releases)

URL to install Terramate, when TM_REMOTE differ from its default value, TM_INSTALL_MODE is set to “direct” and TM_LIST_MODE is set to “html” (assume an artifact proxy usage).

tenv tm subcommands detect, install, list-remote and use support a --remote-url, -u flag version.

See advanced remote configuration for more details.

TM_REMOTE_PASSWORD

String (Default: “”)

Could be used with TM_REMOTE_USER to specify HTTP basic auth when same credential are used with TM_REMOTE and TM_LIST_URL (instead of https://user:[email protected] URL format).

TM_REMOTE_USER

String (Default: “”)

Could be used with TM_REMOTE_PASSWORD to specify HTTP basic auth when same credential are used with TM_REMOTE and TM_LIST_URL (instead of https://user:[email protected] URL format).

TM_DEFAULT_CONSTRAINT

String (Default: “”)

If not empty string, this variable overrides Terramate default constraint, specified in ${TENV_ROOT}/Terramate/constraint file.

TM_DEFAULT_VERSION

String (Default: “”)

If not empty string, this variable overrides Terramate fallback version, specified in ${TENV_ROOT}/Terramate/version file.

TM_VERSION

String (Default: “”)

If not empty string, this variable overrides Terramate version, specified in .terramate-version files.

tenv tm subcommands install and detect also respects this variable.

e.g. with :

$ terramate version
0.13.0

then :

$ TM_VERSION=0.12.0 terramate version
0.12.0

Atmos environment variables

ATMOS_INSTALL_MODE

String (the default depend on ATMOS_REMOTE, without change on it, it is “api” else it is “direct”)

  • “api” install mode retrieve download url of Atmos from Github REST API (ATMOS_REMOTE must comply with it).
  • “direct” install mode generate download url of Atmos based on ATMOS_REMOTE.

See advanced remote configuration for more details.

ATMOS_LIST_MODE

String (the default depend on ATMOS_LIST_URL, without change on it, it is “api” else it is “html”)

  • “api” list mode retrieve information of Atmos releases from Github REST API (ATMOS_LIST_URL must comply with it).
  • “html” list mode extract information of Atmos releases from parsing an html page in ATMOS_LIST_URL.

See advanced remote configuration for more details.

ATMOS_LIST_URL

String (Default: copy ATMOS_REMOTE)

Allow to override the remote url only for the releases listing.

See advanced remote configuration for more details.

ATMOS_REMOTE

String (Default: https://api.github.com/repos/cloudposse/atmos/releases)

URL to install Atmos when ATMOS_REMOTE differ from its default value, ATMOS_INSTALL_MODE is set to “direct” and ATMOS_LIST_MODE is set to “html” (assume an artifact proxy usage).

tenv atmos subcommands detect, install, list-remote and use support a --remote-url, -u flag version.

See advanced remote configuration for more details.

ATMOS_REMOTE_PASSWORD

String (Default: “”)

Could be used with ATMOS_REMOTE_USER to specify HTTP basic auth when same credential are used with ATMOS_REMOTE and ATMOS_LIST_URL (instead of https://user:[email protected] URL format).

ATMOS_REMOTE_USER

String (Default: “”)

Could be used with ATMOS_REMOTE_PASSWORD to specify HTTP basic auth when same credential are used with ATMOS_REMOTE and ATMOS_LIST_URL (instead of https://user:[email protected] URL format).

ATMOS_DEFAULT_CONSTRAINT

String (Default: “”)

If not empty string, this variable overrides Atmos default constraint, specified in ${TENV_ROOT}/Atmos/constraint file.

ATMOS_DEFAULT_VERSION

String (Default: “”)

If not empty string, this variable overrides Atmos fallback version, specified in ${TENV_ROOT}/Atmos/version file.

ATMOS_VERSION

String (Default: “”)

If not empty string, this variable overrides Atmos version, specified in .atmos-version files.

tenv atmos subcommands install and detect also respects this variable.

e.g. with :

$ atmos version
👽 Atmos v1.72.0 on linux/amd64

then :

$ ATMOS_VERSION=1.70 atmos version
👽 Atmos v1.70.0 on linux/amd64

version files

default version file

The TENV_ROOT/<TOOL>/version file is the tool default version used when no project specific or user specific are found. It can be written with tenv <tool> use.

opentofu version files

If you put a .opentofu-version file in the working directory, one of its parent directory, or user home directory, tenv detects it and uses the version written in it. Note, that TOFUENV_TOFU_VERSION can be used to override version specified by .opentofu-version file.

Recognize same values as tenv tofu use command.

See required_version docs.

terraform version files

If you put a .terraform-version or .tfswitchrc file in the working directory, one of its parent directory, or user home directory, tenv detects it and uses the version written in it. Note, that TFENV_TERRAFORM_VERSION can be used to override version specified by those files.

Recognize same values as tenv tf use command.

See required_version docs.

terragrunt version files

If you put a .terragrunt-version or a .tgswitchrc file in the working directory, one of its parent directory, or user home directory, tenv detects it and uses the version written in it. tenv also detect a version field in a .tgswitch.toml in same places. Note, that TG_VERSION can be used to override version specified by those files.

Recognize same values as tenv tg use command.

terragrunt.hcl or root.hcl file

Terragrunt now recommends using root.hcl instead of terragrunt.hcl as the root configuration file name.

If a terragrunt.hcl, root.hcl, or their .json equivalents exist in the working directory, a parent directory, or the user home directory, tenv will read constraints from the terraform_version_constraint or terragrunt_version_constraint field (depending on proxy or subcommand used).

If both root.hcl and terragrunt.hcl (or their .json versions) are present, terragrunt.hcl takes precedence.

terramate version files

If you put a .terramate-version file in the working directory, one of its parent directory, or user home directory, tenv detects it and uses the version written in it. Note, that TM_VERSION can be used to override version specified by those files.

Recognize same values as tenv tm use command.

atmos version files

If you put a .atmos-version file in the working directory, one of its parent directory, or user home directory, tenv detects it and uses the version written in it. Note, that ATMOS_VERSION can be used to override version specified by those files.

Recognize same values as tenv atmos use command.

required_version

the latest-allowed or min-required strategies scan through your IAC files (see list in project binaries) and identify a version conforming to the constraint in the relevant files. They fallback to latest when no IAC files and no default constraint are found, and can optionally be used with a default constraint as detailed in project binaries.

Currently the format for Terraform required_version and OpenTofu required_version are very similar, however this may change over time, always refer to docs for the latest format specification.

example:

version = ">= 1.2.0, < 2.0.0"

This would identify the latest version at or above 1.2.0 and below 2.0.0

Troubleshooting

Terragrunt >= 1.1.4 fails because it selects the OpenTofu proxy from PATH

Since Terragrunt v1.1.4, when --tf-path is not set, Terragrunt picks the binary it wraps by looking for tofu on your PATH and falls back to terraform when it isn’t there (it no longer probes with tofu -version first).

tenv installs proxy binaries for OpenTofu in ~/.tenv/bin even when OpenTofu is not installed. If that directory is on your PATH, Terragrunt will select the OpenTofu proxy and run tofu -version. If OpenTofu is not installed and TENV_AUTO_INSTALL is not set, the proxy exits with code 42, and Terragrunt reports the failure instead of falling back to Terraform.

Solutions:

  • Set TG_TF_PATH (or --tf-path) to point to the binary you want Terragrunt to use, for example:
    export TG_TF_PATH=$(which terraform)
    
  • Or install the OpenTofu version that matches your project (tenv opentofu install / tenv opentofu use), or set TENV_AUTO_INSTALL=true to let the proxy install it on demand.

Technical details

Project binaries

All the proxy binaries return the exit code 42 on error happening before proxied command call.

Every tool proxy resolves the version to run with the same order:

  1. the tool version environment variable (e.g. TOFUENV_TOFU_VERSION, TFENV_TERRAFORM_VERSION)
  2. the tool version files (names and priority listed per tool below), searched in the working directory, then each of its parent directories up to the filesystem root, then the user home directory; the first directory containing a matching file wins, and inside a directory files are tried in the listed order
  3. the tool default version environment variable (e.g. TOFUENV_TOFU_DEFAULT_VERSION)
  4. the ${TENV_ROOT}/<TOOL>/version default version file (written with tenv <tool> use)
  5. the tool fallback strategy (usually latest-allowed), or an error when there is none
tofu

The tofu command in this project is a proxy to OpenTofu’s tofu command managed by tenv.

The version resolution order is :

  • TOFUENV_TOFU_VERSION environment variable
  • .opentofu-version file
  • .tool-versions file
  • terraform_version_constraint from terragrunt.hcl file
  • terraform_version_constraint from terragrunt.hcl.json file
  • terraform_version_constraint from root.hcl file
  • terraform_version_constraint from root.hcl.json file
  • TOFUENV_TOFU_DEFAULT_VERSION environment variable
  • ${TENV_ROOT}/OpenTofu/version file (can be written with tenv tofu use)
  • latest-allowed

The latest-allowed strategy rely on required_version from .tofu, .tofu.json, .tf or .tf.json files with a fallback to latest when no constraint are found. Moreover it is possible to add a default constraint with TOFUENV_TOFU_DEFAULT_CONSTRAINT environment variable or ${TENV_ROOT}/OpenTofu/constraint file (can be written with tenv tofu constraint). The default constraint is added while using latest-allowed, min-required or custom constraint. A default constraint with latest-allowed or min-required will avoid the fallback to latest when there is no .tf or .tf.json files.

terraform

The terraform command in this project is a proxy to HashiCorp’s terraform command managed by tenv.

The version resolution order is :

  • TFENV_TERRAFORM_VERSION environment variable
  • .terraform-version file
  • .tfswitchrc file
  • .tool-versions file
  • terraform_version_constraint from terragrunt.hcl file
  • terraform_version_constraint from terragrunt.hcl.json file
  • terraform_version_constraint from root.hcl file
  • terraform_version_constraint from root.hcl.json file
  • TFENV_TERRAFORM_DEFAULT_VERSION environment variable
  • ${TENV_ROOT}/Terraform/version file (can be written with tenv tf use)
  • latest-allowed

The latest-allowed strategy rely on required_version from .tf or .tf.json files with a fallback to latest when no constraint are found. Moreover it is possible to add a default constraint with TFENV_TERRAFORM_DEFAULT_CONSTRAINT environment variable or ${TENV_ROOT}/Terraform/constraint file (can be written with tenv tf constraint). The default constraint is added while using latest-allowed, min-required or custom constraint. A default constraint with latest-allowed or min-required will avoid the fallback to latest when there is no .tf or .tf.json files.

terragrunt

The terragrunt command in this project is a proxy to Gruntwork’s terragrunt command managed by tenv.

The version resolution order is :

  • TG_VERSION environment variable
  • .terragrunt-version file
  • .tgswitchrc file
  • version from tgswitch.toml file
  • .tool-versions file
  • terragrunt_version_constraint from terragrunt.hcl file
  • terragrunt_version_constraint from terragrunt.hcl.json file
  • terragrunt_version_constraint from root.hcl file
  • terragrunt_version_constraint from root.hcl.json file
  • TG_DEFAULT_VERSION environment variable
  • ${TENV_ROOT}/Terragrunt/version file (can be written with tenv tg use)
  • latest-allowed

The latest-allowed strategy has no information for Terragrunt and will fallback to latest unless there is default constraint. Adding a default constraint could be done with TG_DEFAULT_CONSTRAINT environment variable or ${TENV_ROOT}/Terragrunt/constraint file (can be written with tenv tg constraint). The default constraint is added while using latest-allowed, min-required or custom constraint. A default constraint with latest-allowed or min-required will avoid there fallback to latest.

terramate

The terramate command in this project is a proxy to Terramate’s terramate command managed by tenv.

The version resolution order is :

  • TM_VERSION environment variable
  • .terramate-version file
  • TM_DEFAULT_VERSION environment variable
  • ${TENV_ROOT}/Terramate/version file (can be written with tenv tm use)
  • latest-allowed

The latest-allowed strategy has no information for Terramate and will fallback to latest unless there is default constraint. Adding a default constraint could be done with TM_DEFAULT_CONSTRAINT environment variable or ${TENV_ROOT}/Terramate/constraint file (can be written with tenv tm constraint). The default constraint is added while using latest-allowed, min-required or custom constraint. A default constraint with latest-allowed or min-required will avoid there fallback to latest.

atmos

The atmos command in this project is

README 内容过长,已截取前 64 KB。完整内容请前往 GitHub 仓库查看。

评论

暂无评论