Fix Missing Terraform Provider for darwin_arm64 platform (Apple M1)

Priyankar Prasad
2 min readJan 22, 2023

--

Terraform is a popular infrastructure as code tool that allows users to define and provision infrastructure resources in a consistent and repeatable manner. A Terraform provider is a plugin that allows Terraform to interact with a specific service or platform, such as AWS or Azure. Providers are responsible for understanding the API of the service they interact with and translating Terraform’s configuration files into API calls. This allows users to define their infrastructure resources using Terraform’s simple, declarative language and provision those resources on the desired service or platform.

One of the key benefits of using Terraform providers is that it allows users to manage multiple services and platforms from a single tool. This can greatly simplify the process of managing and provisioning infrastructure, as well as reducing the risk of errors and inconsistencies. Another benefit of Terraform providers is that they can be easily extended or customised to support new services or platforms. But with the release of Apple silicon M1 chip some of the Providers did not release a version which supports darwin_arm64 platform. Easiest way to fix this issue is to compile and build the correct version of the Provider on darwin_arm64 platform.

Below are the steps on how to build a Provider and use it with the terraform. GO should be installed and configured before hand since, it will be used to build the Provider package.

Step 1: Download the correct version of the Provider source code.

git clone https://github.com/hashicorp/terraform-provider-template.git
cd terraform-provider-template/

Step 2: Build the Provider using go.

go build

Step 3: Move the go binary to the correct path(create the directory path if it does not exists).

mv terraform-provider-template ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64/

Step 4: Grant execute permissions to the binary.

chmod +x ~/.terraform.d/plugins/registry.terraform.io/hashicorp/template/2.2.0/darwin_arm64/terraform-provider-template

Step 5: Remove the existing Provider block from .terraform.lock.hcl file.

Each Provider source code can be found in Terraform GitHub. This method can be used for many Providers to fix this platform issue. Overall, Terraform providers are an essential component of the Terraform ecosystem, allowing users to easily and consistently provision infrastructure resources on a wide variety of services and platforms.

--

--