【问题标题】:No available provider "azure" plugins are compatible with this Terraform version. Azurerm -1.28 Terraform -没有可用的提供者“azure”插件与此 Terraform 版本兼容。 Azurerm -1.28 Terraform -
【发布时间】:2020-02-13 18:28:56
【问题描述】:

我的环境在 OSX 上如下所示。

NJ033-10126375:旧示例 10126375$ terraform 版本 Terraform v0.12.10 + 提供者.azurerm v1.28.0 + provider.random v2.2.1

编辑:当我运行terraform providers 时,我得到以下信息

.
├── provider.azure
├── provider.azurerm ~>1.35
└── provider.random

我在 terraform 中收到以下错误。

No available provider "azure" plugins are compatible with this 

Terraform version.

From time to time, new Terraform major releases can change the requirements for
plugins such that older plugins become incompatible.

Terraform checked all of the plugin versions matching the given constraint:
    (any version)

Unfortunately, none of the suitable versions are compatible with this version
of Terraform. If you have recently upgraded Terraform, it may be necessary to
move to a newer major release of this provider. Alternatively, if you are
attempting to upgrade the provider to a new major version you may need to
also upgrade Terraform to support the new version.

Consult the documentation for this provider for more information on
compatibility between provider versions and Terraform versions.

下面是我的 vars.auto.tfvars(更改版本或省略它没有帮助)

variable subscription_id {}
variable tenant_id {}
variable client_id {}
variable client_secret {}

provider "azurerm" {
   subscription_id = "${var.subscription_id}"
   tenant_id = "${var.tenant_id}"
   client_id = "${var.client_id}"
   client_secret = "${var.client_secret}"
   version = "=1.28.0"
}

更有趣的是,这段代码几天前还在工作,我尝试再次运行它而没有任何变化,但它已经损坏了。然后我使用 brew upgrade terraform ,然后其他正在工作的项目不再工作。

我几乎无法通过 terraform init。

问题已解决这是由于使用 azure_public_ip 而不是 azurerm_public_ip 的拼写错误。

【问题讨论】:

  • 我也通过使用 azurerm_ 前缀解决了同样的问题。但为什么它会产生误导性错误

标签: terraform terraform-provider-azure


【解决方案1】:

我不相信 AzureRM Terraform 提供程序在 1.29 之前支持 0.12.x。将您的提供程序版本约束更改为:

version = "~>1.35"

这将为您提供最新版本,并且还可以从那里升级。这是 AzureRM 提供程序更改日志的链接。

https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/CHANGELOG.md

【讨论】:

  • 嘿,Scott,你是怎么发现这个的,它在某个 github 页面上吗?我在试图弄清楚哪个版本与哪个版本匹配时遇到了麻烦。
  • @FrankVisaggio - 添加了我的答案的链接。 Github 是你的朋友!!我还要说对特定提供程序版本(“==1.28.0”)的硬编码可能没有必要。主要版本可能会导致重大中断,但未成年人应该没问题。使用我在答案中的内容将确保您获得更新。
  • 我仍然收到类似的错误,如果我看起来它似乎在抱怨 Azure 版本不是 azure RM。编辑了我的原始帖子以显示 terraform 提供程序显示的内容。
  • 我没有看到任何名为“azure”的提供程序。你能分享你所有的代码吗?
  • 发现我在资源中有一个愚蠢的错字,说“azure_public_ip”而不是“azurerm_public_ip”
猜你喜欢
  • 2022-06-16
  • 2021-03-29
  • 2021-09-24
  • 2020-12-12
  • 1970-01-01
  • 1970-01-01
  • 2020-06-11
  • 2021-06-09
  • 2021-03-08
相关资源
最近更新 更多