我们正在尝试使用这里的文档https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/vpn_gateway_connection#bgp_enabled创建一个azurerm_vpn_gateway_connection我们正在使用
resource "azurerm_vpn_gateway_connection" "example" {
name = "example"
vpn_gateway_id = azurerm_vpn_gateway.example.id
remote_vpn_site_id = azurerm_vpn_site.example.id
vpn_link {
name = "link1"
vpn_site_link_id = azurerm_vpn_site.example.vpn_site_link[0].id
}
vpn_link {
name = "link2"
vpn_site_link_id = azurerm_vpn_site.example.vpn_site_link[1].id
}
}
我们运行地形计划时出现错误
│ Error: Unsupported attribute
│
│ on main.tf line 95, in resource "azurerm_vpn_gateway_connection" "example":
│ 95: vpn_site_link_id = azurerm_vpn_site.example.vpn_site_link[0].id
│
│ This object has no argument, nested block, or exported attribute named "vpn_site_link".
╵
问题是azurerm_vpn_site没有属性vpn_site_link
。我猜也许你想要:
vpn_site_link_id = azurerm_vpn_site.example.link[0].id
第二种情况类似。