简体   繁体   中英

Terraform installing a provider when it isn't needed

Due to using an M1 mac, I am receiving an error that is preventing a successful terraform init (see below); this is caused by terraform trying to install the hasicorp/template provider when it isn't needed. Why is the hashicorp/template provider trying to install when there aren't any resources requiring it?

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

This is documented here: https://discuss.hashicorp.com/t/template-v2-2-0-does-not-have-a-package-available-mac-m1/35099

Specifically, terraform keeps trying to install the hashicorp/template provider even though I'm not using template_file or any other entity from that provider; I tried deleting.terraform and my lock file and still I have this issue:

Initializing provider plugins...
- terraform.io/builtin/terraform is built in to Terraform
- Finding latest version of hashicorp/template...
- Finding hashicorp/aws versions matching "~> 3.0"...
- Finding latest version of hashicorp/random...

The problem was that the statefile was still referencing a template_file object. I removed it via terraform state rm <object> , which now allows a successful terraform init.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM