0

我们正在尝试使用此处的文档创建 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".
╵
4

1 回答 1

1

问题是azurerm_vpn_site没有属性vpn_site_link。我想也许你想要:

vpn_site_link_id = azurerm_vpn_site.example.link[0].id

对于第二种情况也是如此。

于 2021-09-16T21:51:27.773 回答