繁体   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