Unified, minimal terraform and terragrunt version manager.
- Linux (amd64, arm64)
- NOTE: only terraform 0.11.15, 0.12.{30,31}, 0.13.5+ and terragrunt 0.28.12+ ship linux arm64 binaries
- MacOS (amd64)
- Windows (amd64)
💡 OpenSSL 1.1 is required on Linux and macOS
- Download terve for your platform, check
SHA256SUMS
, and install terve inPATH
, e.g./usr/local/bin/terve
-
On Linux/macOS, file integrity can be checked like so
$ sha256sum -c --ignore-missing 2>/dev/null SHA256SUMS terve_linux_amd64: OK
-
On Linux/macOS, be sure to make the binary executable:
chmod +x terve
-
- Create the
~/.terve
directory tree by runningterve --bootstrap
- Add the
~/.terve/bin
directory toPATH
(using e.g..bashrc
or Windows' control panel) - Copy Hashicorp's PGP public key in
~/.terve/etc/terraform.asc
(read-only, mode0444
on linux/macOS)- This public key is used to verify terraform binary download PGP signatures
- If not installed (or bad file permissions), terve will log a warning for terraform installs
Terve uses hard links to configure selected terraform/terragrunt binary versions.
All files are kept in directory ~/.terve
like so (example directory tree for Linux):
/home/whoami/.terve
├── bin
│ ├── terraform
│ └── terragrunt
├── etc
│ └── terraform.asc
└── opt
├── terraform
│ ├── 0.14.11
│ └── 0.15.4
└── terragrunt
├── 0.28.10
├── 0.28.39
└── 0.29.4
Managed <binary>
is tf
(long form: terraform
) or tg
(long form: terragrunt
).
Install, select and remove are idempotent, and can be run multiple times for a version without error.
List remote does not return pre-release versions (e.g. terraform 0.15.0-rc2
), but such versions can be installed/selected/removed (for testing).
Lists installed or available (remote) versions, sorted latest first (descending).
Syntax: terve l[ist] <binary> [spec]
where spec
is r[emote]
terve l tf
lists installed (local) terraform versionsterve l tf r
lists available (remote) terraform versionsterve l tf r | tac
lists available terraform versions, sorted oldest firstterve l tg r | grep 0.29.
lists available terragrunt 0.29.x versions
Installs a specific version.
Syntax: terve i[nstall] <binary> <semver>
terve i tf 0.12.31
installs terraform version 0.12.31terve i tf "$(terve l tf r | head -n1)"
installs latest version of terraformterve i tf "$(cat .terraform-version)"
installs terraform version defined in.terraform-version
terve i tg "$(cat .terragrunt-version)"
installs terragrunt version defined in.terragrunt-version
terve l tg r | grep 0.29. | xargs -n1 -P4 terve i tg
installs all available terragrunt 0.29.x versions
WARNING: terragrunt releases < 0.18.1
do not ship SHA256SUMS
files, so their file integrity cannot be checked
Selects a specific version for use. That version must be installed first.
Syntax: terve s[elect] <binary> <semver>
terve s tf 0.12.31
selects terraform version 0.12.31terve s tf "$(cat .terraform-version)"
selects terraform version defined in.terraform-version
Removes a specific version.
Syntax: terve r[emove] <binary> <semver>
terve r tf 0.12.31
removes terraform version 0.12.31terve l tf | grep 0.11. | xargs -n1 terve r tf
removes all installed terraform 0.11.x versions
Install these scripts into ~/.terve/bin
to make use of them.
Use terraform and terragrunt versions defined in .terraform-version
and .terragrunt-version
(in current working directory or any parent directory)
#!/bin/sh
upcat() {
file="$1"
while [ "$PWD" != "/" ]; do
if [ -r "$file" ]; then
cat "$file"
break
fi
cd ..
done
}
tf_version="$(upcat .terraform-version)"
tg_version="$(upcat .terragrunt-version)"
if [ -z "$tf_version" ]; then
echo "ERROR: No .terraform-version found"
exit 1
fi
if [ -z "$tg_version" ]; then
echo "ERROR: No .terragrunt-version found"
exit 2
fi
terve i tf "$tf_version" && terve s tf "$tf_version"
terve i tg "$tg_version" && terve s tg "$tg_version"
You need cargo (Rust's build tool). To run all tests, run cargo test
.
Visual Studio Code with rust-analyzer provides a reasonable IDE experience.
To build the binary, run cargo build --release
. Binary is then found in target/release/
.