1

I use Terraform v1.0.11 on my Mac M1. When I try to run terraform init, I run into the following error:

Initializing provider plugins...
- Finding latest version of hashicorp/local...
- Finding latest version of hashicorp/null...
- Reusing previous version of hashicorp/aws from the dependency lock file
- Finding latest version of hashicorp/random...
- Finding latest version of hashicorp/template...
- Finding latest version of hashicorp/external...
- Installing hashicorp/external v2.1.0...
- Installed hashicorp/external v2.1.0 (signed by HashiCorp)
- Installing hashicorp/local v2.1.0...
- Installed hashicorp/local v2.1.0 (signed by HashiCorp)
- Installing hashicorp/null v3.1.0...
- Installed hashicorp/null v3.1.0 (signed by HashiCorp)
- Using previously-installed hashicorp/aws v3.53.0
- Installing hashicorp/random v3.1.0...
- Installed hashicorp/random v3.1.0 (signed by HashiCorp)
╷
│ Error: Incompatible provider version
│ 
│ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64.
│ 
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider
│ may have different platforms supported.

My provider provider info:

terraform {
  required_providers {
    aws = {
      version = "~> 3.53.0"
    }
  }
}

I understand that the provider version is not available for M1. Is there any workaround for this?

I tried using this: https://github.com/hashicorp/terraform/issues/27257#issuecomment-754777716, but with provider version 3.53.0, but running into issues.

Is there any workaround for this problem?

Harish J
  • 146
  • 1
  • 3
  • 12
  • try 3.63.0 works for me – Brian McCall Nov 19 '21 at 18:13
  • According to the error message, it is the `template` provider that is incompatible. Also, that provider is deprecated anyway, so you can upgrade its usage on your configs. – Matthew Schuchard Nov 19 '21 at 18:56
  • @MattSchuchard I am pretty new to Terraform. Can you please explain what a `template` is? I also tried changing provider version to 3.63.0 like @BrianMcCall said. But its not working. – Harish J Nov 20 '21 at 12:42
  • You need to remove the `template` provider from your configuration. – Matthew Schuchard Nov 21 '21 at 12:08
  • @MattSchuchard Even if I remove the `template` part I am getting the same error. It shows `Provider registry.terraform.io/hashicorp/aws v3.66.0 does not have a package available for your current platform, darwin_amd64.` – Harish J Nov 22 '21 at 12:03
  • As stated in the error message, the provider is not available on your platform. You mentioned you tried the workaround of building the provider yourself but you "ran into issues" -- What issues did you run into? Maybe your question is more about how to build and use the package locally for your platform then? – sytech Nov 24 '21 at 17:02

1 Answers1

1

You can use what they say on this answer to run on your M1 which is to compile the resource for your architecture.

However template is a deprecated resource and you can use templatefile which works correctly on M1.

Nic
  • 327
  • 1
  • 18