When I run terraform init
for my Google Cloud Platform project on my Apple Silicon macbook pro I get this error.
Provider registry.terraform.io/hashicorp/google v3.57.0 does not have a package available for your current platform, darwin_arm64.
How can I work around this? I thought that the Rosetta2 emulator would check this box, but alas...
Build Terraform from scratch by using the tfenv package, which can build a specific version adapted to the platform architecture.
I ran the following to install a version that works under my M1 Macbook (version 1.3.3 in this case):
brew uninstall terraform
brew install tfenv
TFENV_ARCH=amd64 tfenv install 1.3.3
tfenv use 1.3.3
Thanks for this repo: https://github.com/kreuzwerker/m1-terraform-provider-helper. This will remove the overhead of building and compiling from us.
Usage:
brew install kreuzwerker/taps/m1-terraform-provider-helper
m1-terraform-provider-helper activate # (In case you have not activated the helper)
m1-terraform-provider-helper install hashicorp/template -v v2.2.0 # Install and compile
This will compile the provider for our arm_64 in the location:
~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64
For this to be working, these are my findings:-
.terraform.lock.hcl
m1-terraform-provider-helper lockfile upgrade
which finds and updates these checksumsGo ahead now !!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With