tfutils / tfenv

Terraform version manager
MIT License
4.53k stars 453 forks source link

Setting export TFENV_ARCH=arm on Apple Silicon results in curl: (22) The requested URL returned error: 403 #319

Closed nodesocket closed 2 years ago

nodesocket commented 2 years ago
MacBook-Pro ➜  tfenv install 1.0.4
Installing Terraform v1.0.4
Downloading release tarball from https://releases.hashicorp.com/terraform/1.0.4/terraform_1.0.4_darwin_arm.zip
curl: (22) The requested URL returned error: 403

Tarball download failed

My ~/.zshrc simply has:

export TFENV_ARCH=arm
nodesocket commented 2 years ago

Needs to be arm64. The README.md should probably be updated to default to arm64 since arm is gonna be pretty rare these days. I suspect most people are coming from Apple Silicon machines.

mattlubner commented 2 years ago

In case anyone else comes across this issue and is also still on an older version of terraform, I had to use TFENV_ARCH=amd64 tfenv install 0.15.5 to get around the 403 error on my M1 mac.

It seems that, without TFENV_ARCH being set, newer versions of tfenv don't use appropriate defaults for older terraform versions, which results in the 403 error.

mhemken-vts commented 2 years ago

The solution to use TFENV_ARCH=amd64 does not solve the situation where you need arm64. This is 100% a blocking issue for those of us with a company issued M1 while maintaining stuff at pre 1.0 versions.

dylan-chong commented 2 years ago

https://releases.hashicorp.com/terraform/0.13.7/

Looking at this page there's a terraform_0.13.7_darwin_amd64.zip link but not one for arm64. Is this a typo? on Hashicorp's part?

rgeraskin commented 2 years ago

So it seems that there is no terraform 0.13.7 for darwin arm64. Looks like darwin arm64 build starts from 1.0.2

Zordrak commented 2 years ago

Between the comments above and the README updates in master, this issue seems resolved.