簡體   English   中英

Terraform 在不需要時安裝提供程序

[英]Terraform installing a provider when it isn't needed

由於使用 M1 mac,我收到一個錯誤,阻止 terraform 初始化成功(見下文); 這是由 terraform 在不需要時嘗試安裝 hasicorp/模板提供程序引起的。 為什么 hashicorp/模板提供程序在沒有任何資源需要時嘗試安裝?

│ 錯誤:不兼容的提供程序版本 │ │ Provider registry.terraform.io/hashicorp/template v2.2.0 沒有適用於您當前平台 darwin_arm64 的 package。

這記錄在這里: https://discuss.hashicorp.com/t/template-v2-2-0-does-not-have-a-package-available-mac-m1/35099

具體來說,terraform 一直嘗試安裝 hashicorp/模板提供程序,即使我沒有使用 template_file 或該提供程序的任何其他實體; 我嘗試刪除 .terraform 和我的鎖定文件,但我仍然遇到這個問題:

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

問題是狀態文件仍然引用 template_file object。我通過terraform state rm <object>刪除了它,現在允許成功的 terraform 初始化。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM