A seamless launcher for Terraform.
Note: installing terraform-demux
via Homebrew will automatically create a symlink named terraform
.
brew tap etsy/terraform-demux https://github.com/etsy/terraform-demux
brew install terraform-demux
- Grab the latest binary from the releases page
- Copy it to a location in your
$PATH
asterraform
(or leave it asterraform-demux
if you'd like)
Simply navigate to any folder that contains Terraform configuration and run terraform
as you usually would. terraform-demux
will attempt to locate the appropriate version constraint by searching in the current working directory and recursively through parent directories. If terraform-demux
cannot determine a constraint, it will default to the latest possible version.
terraform-demux
supports a native arm64
build that can also run amd64
versions of terraform
by specifying the TF_DEMUX_ARCH
environment variable. This might be necessary for terraform
workspaces that need older terraform
versions that do not have arm64
builds, or use older providers that do not have arm64
builds.
It is recommended to set up the following shell alias for handy amd64
invocations:
alias terraform-amd64="TF_DEMUX_ARCH=amd64 terraform-demux"
Setting the TF_DEMUX_LOG
environment variable to any non-empty value will cause terraform-demux
to write out debug logs to stderr
.
terraform-demux
keeps a cache of Hashicorp's releases index and downloaded Terraform binaries in the directory returned by os.UserCacheDir, under terraform-demux/
(e.g. ~/Library/Caches/terraform-demux/
on MacOS).