azurerm_vpn_gateway_connection 不支持的属性 vpn_site_link_id

azurerm_vpn_gateway_connection Unsupported attribute vpn_site_link_id

我们正在尝试使用此处的文档创建一个 azurerm_vpn_gateway_connection https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/vpn_gateway_connection#bgp_enabled 我们正在使用

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 
  }
}

我们在 运行 terraform plan

时遇到错误
│ 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

第二种情况类似