For Terraform Installation and Successful terraform init
Steps to install terraform of your choice of version using Homebrew:
- brew install tfenv
- tfenv list_remote
- tfenv install
tfenv install 1.0.9 #example
tfenv use 1.0.9 #to switch into this version
Now, while executing terraform init you might face the below error if you are working in a MAC with M1 chip in it,
Error: Incompatible provider version
│
│ Provider Terraform Registry v2.2.0 does not have a
│ package available for your current platform, darwin_arm64.
Please follow the steps given below:
- brew install kreuzwerker/taps/m1-terraform-provider-helper
- m1-terraform-provider-helper activate
- m1-terraform-provider-helper install hashicorp/template -v v2.2.0
What is “kreuzwerker/taps/m1-terraform-provider-helper” ?
A CLI to manage the installation of terraform providers for the Mac M1 chip.
For complete info:
https://kreuzwerker.de/en/post/use-m1-terraform-provider-helper-to-compile-terraform-providers-for-mac-m1
After following the above steps, terraform init will run successfully !!!