Not all Terraform providers are built for arm64
.
One solution here is to install Terraform as amd64
which can be easily done from the downloads page.
However, for those who are using and switching between versions of Terraform often, a more streamlined approach is desirable.
Enter asdf
.
Update ~/.zshrc
to include:
plugins=(asdf)
Install asdf
with git
:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
Reload your shell
. ~/.zshrc
asdf info
Install asdf
Terraform profile with:
asdf plugin-add terraform https://github.com/asdf-community/asdf-hashicorp.git
Install terraform
with:
# Override to install amd64, install specific version (can be "latest")
export TF_VERSION="latest"
export ASDF_HASHICORP_OVERWRITE_ARCH="amd64"
# install and set globally
asdf install terraform ${TF_VERSION}
asdf global terraform ${TF_VERSION}
# show version for good measure
terraform -v
Note: This can also go into your
.zshrc
file for future use on a specific version
terraform_install () {
export TF_VERSION=$1
export ASDF_HASHICORP_OVERWRITE_ARCH="amd64"
# install and set globally
asdf install terraform ${TF_VERSION}
asdf global terraform ${TF_VERSION}
# terraform version for good measure
terraform -v
}