目前正在努力尝试在 azurerm_virtual_network_gateway 资源中定义 bgp_settings block 。
我定义了以下内容:
resource "azurerm_virtual_network_gateway" "Customer" {
name = var.vng_name
location = var.location
resource_group_name = var.resource_group_name
type = "Vpn"
vpn_type = "RouteBased"
active_active = true
enable_bgp = true
sku = "VpnGw1"
generation = "Generation1"
ip_configuration {
name = "vnetGatewayConfig1"
public_ip_address_id = azurerm_public_ip.Customer_IP1.id
private_ip_address_allocation = "Dynamic"
subnet_id = azurerm_subnet.gateway_subnet.id
}
ip_configuration {
name = "vnetGatewayConfig2"
public_ip_address_id = azurerm_public_ip.Customer_IP2.id
private_ip_address_allocation = "Dynamic"
subnet_id = azurerm_subnet.gateway_subnet.id
}
bgp_settings {
asn = 65000
peering_addresses {
apipa_addresses = ["169.254.21.1"]
ip_configuration_name = azurerm_public_ip.Customer_IP1.name
}
peering_addresses {
apipa_addresses = ["169.254.21.5"]
ip_configuration_name = azurerm_public_ip.Customer_IP2.name
}
}
}
但由于 peering_addresses 子 block 定义而出现错误。如果我删除它们,所有内容都会正确部署,但没有 APIPA 地址。
有人已经配置了上述内容吗?不幸的是,到目前为止我还没有找到任何好的例子。
非常感谢。
最佳答案
您还必须配置 block azurerm_virtual_network_gateway_connection
更多信息https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network_gateway_connection
关于azure - 如何在Azure azurerm_virtual_network_gateway资源中设置 "bgp_settings" block ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74189558/