If you have Mac M1 i.e darwin_arm64 and getting the error “provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64” while running the “terraform init” command, then this is the troubleshooting guide for you.
Table of Contents
After installing the Terraform CLI on a new Macbook (M1), if you are seeing the below message, then you will have to follow the below steps to get it resolved.
It is a simple process and should take only a few mins of your time.
provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64
- Brew installed on macOS
- Terraform CLI
- Internet connection 🙂
Cause of the issue
This issue is occurring as some of the providers have not yet updated their modules for the M1 chip and one of them is Hashicorp.
Steps to Resolve Hashicorp/Template v2.2.0 does not have a Package Issue
If you want to resolve the issue while running Terraform commands, you just need to compile the concerning provider package for your platform i.e. darwin_arm64.
But you don’t have to do that as we already have such a utility present.
Yes, Martin Wentzel from kreuzwerker.de has already developed that and it is free to use. Check more about this utility here: https://kreuzwerker.de/en/post/use-m1-terraform-provider-helper-to-compile-terraform-providers-for-mac-m1
Here are the simple steps to resolve this issue:
1. Install “m1-terraform-provider-helper” with the help of the below command:
brew install kreuzwerker/taps/m1-terraform-provider-helper
2. Activate the plugin or helper utility.
3. Install and compile the “hashicorp/template v2.2.0”.
m1-terraform-provider-helper install hashicorp/template -v v2.2.0
Now you have hashicorp/template v2.2.0 compiled and installed for M1.
Now, you should be able to run the ‘terraform init‘ command. If you are getting any error with that command, just try to run it with the “-upgrade” option
terraform init -upgrade
If your issue is resolved, please do let us know through comments and if you want to get articles related to DevOps, Site Reliability Engineering or System administration, do not forget to subscribe to our free newsletter.