gpt4 book ai didi

azure - provider.azurerm 不支持资源类型 "azurerm_network_interface_security_group_association"

转载 作者:行者123 更新时间:2023-12-03 05:34:36 28 4
gpt4 key购买 nike

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

但是,它在以下行失败:

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
}

这给了我以下错误:

Error: Invalid resource type

on main.tf line 77, in resource "azurerm_network_interface_security_group_association" "nic-nsg":
77: resource "azurerm_network_interface_security_group_association" "nic-nsg" {

The provider provider.azurerm does not support resource type
"azurerm_network_interface_security_group_association".

我不知道为什么,我安装了 Terraform 0.13.0。

最佳答案

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

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

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

至:

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

关于azure - provider.azurerm 不支持资源类型 "azurerm_network_interface_security_group_association",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63574242/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com