How can I get `terraform init` to run on my Apple Silicon Macbook Pro for the Google Provider?

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...


Most providers already have packages available in newer versions. You can update the provider via: terraform init -upgrade If this route is not acceptable for you or if it does not solve the problem, look at the answer below.

Build Terraform's GCP provider from scratch! I modified this walkthrough. https://github.com/hashicorp/terraform/issues/27257#issuecomment-754777716

brew install --build-from-source terraform

This will install Golang as well (and that appears to be working as of this post)

git clone https://github.com/hashicorp/terraform-provider-google.git
cd terraform-provider-google
git checkout v3.22.0
go get -d github.com/pavius/impi/cmd/impi
make tools
go fmt
make build

The following directory probably does not already exist so lets create it and copy the binary we just built.

mkdir -p ${HOME}/.terraform.d/plugins/registry.terraform.io/hashicorp/google/3.22.0/darwin_arm64
cp ${HOME}/go/bin/terraform-provider-google ${HOME}/.terraform.d/plugins/registry.terraform.io/hashicorp/google/3.22.0/darwin_arm64

Note that ${HOME}/go is where your golang install will be located if you don't already have ${GOPATH} already defined. If you do, then modify the above commands to account for the location of your new build binaries.

cp ${GOPATH}/bin/terraform-provider-google ${HOME}/.terraform.d/plugins/registry.terraform.io/hashicorp/google/3.22.0/darwin_arm64

After going back to my project voila!

➜ terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/google...
- Installing hashicorp/google v3.22.0...
- Installed hashicorp/google v3.22.0 (unauthenticated)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other


OK. So, I ''found'' the answer to my problem. You most probably, like me, use the main.tf config that look like this:

terraform {
  required_providers {
    google = {
      source = "hashicorp/google"
      version = "3.22.0"
    }
  }
}

provider "google" {
  credentials = file("foo.json")

  project = "foo"
  region  = "us-central1"
  zone    = "us-central1-c"
}

resource "google_compute_network" "vpc_network" {
  name = "terraform-network"
}

Well, DROP this part, you do not need it:

terraform {
  required_providers {
    google = {
      source = "hashicorp/google"
      version = "3.22.0"
    }
  }
}

If it still not working, reinstall TERRAFORM and start from a new fresh and clean directory for your project.

Hope this can help some one.

BTW, my Terraform version

Terraform v1.1.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.6.0