在 Apple M1 上设置 Terraform v0.14.0

setting up terraform v0.14.0 on Apple M1

关于如何在 Apple M1 上设置 Terraform v0.14.0 的任何指示,因为 tfenv 不支持 Apple M1 上的 v0.14.0

tfenv install v0.14.0
Installing Terraform v0.14.0
Downloading release tarball from https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_darwin_arm64.zip
curl: (22) The requested URL returned error: 403

Tarball download failed

Terraform 是一个简单的可执行文件,您可以从这里下载并解压它: https://releases.hashicorp.com/terraform/0.14.0/:

wget https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_darwin_amd64.zip

unzip terraform_0.14.0_darwin_amd64.zip

请注意,osx 没有 arm64 版本,但是 amd64 在 Mac M1 上工作得很好。

现在您可以将提取的可执行文件复制到 /usr/local/bin 之类的文件夹中,该文件夹应该在您的 PATH 上,这样您就可以从任何地方执行 运行 terraform 命令你的系统。

您可以设置环境变量 TFENV_ARCH 并使用 tfenv

TFENV_ARCH=amd64 tfenv install 0.14.0