azure - 如何在Azure azurerm_virtual_network_gateway资源中设置 "bgp_settings" block ?

标签 azure terraform terraform-provider-azure

目前正在努力尝试在 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

enter image description here enter image description here 更多信息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/

相关文章:

azure - 如何授予应用程序访问其自己的 api 的权限

Azure 服务总线 - 401 40103 : Invalid authorization token signature for post message using CURL

javascript - 带模拟器的 Cosmos DB REST API(目前)

azure - 在 Terraform 中通过 WinRM 连接到远程主机失败

ansible - Terraform 本地执行配置程序中的转义字符

azure - 设置 AKS 群集静态 IP、负载均衡器和入口 Controller 的正确方法是什么?

c# - Microsoft.Azure.KeyVault.Models.KeyVaultErrorException : 'Operation returned an invalid status code ' BadRequest''

Azure Application Insights,如何通过 Azure CLI 更改每日上限

azure - 对每个地形创建的特定对象的引用

azure - 使用 terraform 创建新的 azure 资源组时出错