provider.azurerm不支持​​资源类型“ azurerm_network_interface_security_group_association”

时间:2020-08-25 07:45:43

标签: azure cloud terraform

我有以下要运行的演示脚本: https://learn.hashicorp.com/tutorials/terraform/azure-dependency?in=terraform/azure-get-started#complete-configuration

但是,它在以下行中失败:

<div id="Text">
        Loading<span class="l1">.</span><span class="l2">.</span><span class="l3">.</span>
    </div>

哪个给我以下错误:

resource "azurerm_network_interface_security_group_association" "nic-nsg" {
  network_interface_id      = azurerm_network_interface.nic.id
  network_security_group_id = azurerm_network_security_group.nsg.id
}

我不确定为什么安装了Terraform 0.13.0。

1 个答案:

答案 0 :(得分:1)

我自己解决了这个问题,我猜教程在他们的网站上有些过时了。

只需将版本0.13.0的开头更改为

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "~>1.31"
    }
  }
}

收件人:

provider "azurerm" {
  version = "=2.20.0"
  features {}
}