gpt4 book ai didi

使用 Terraform 运行时 Azure Vnet 对等互连启动状态

转载 作者:行者123 更新时间:2023-12-03 01:15:53 24 4
gpt4 key购买 nike

我使用 terraform 部署了 vnet 对等互连。但一直停留在启动状态。当我手动尝试使用相同的值时没有问题。我该如何修复它?

resource "azurerm_virtual_network_peering" "spoke_aks_peering" {
virtual_network_name = azurerm_virtual_network.virtual_network_spoke.name
resource_group_name = azurerm_resource_group.resource-group_spoke.name
remote_virtual_network_id = azurerm_virtual_network.virtual_network_aks.id
name = "peerspoketoaks"
allow_virtual_network_access = true
allow_forwarded_traffic = true
}

enter image description here

最佳答案

我尝试在我的环境中重现相同的情况,以在 2 个虚拟网络之间创建对等互连:

Note: If the Peering Status is currently Initiated status in Vnet peering,kindly enable the peering on both Vnets to get the status connected.

要解决此问题,请在两个 VNet 上创建对等互连,如下所示。

#Azure Virtual Network peering between Virtual Network stagingtotest and testtostaging
resource "azurerm_virtual_network_peering" "peeringconnection1" {
name = "stagingtotest"
resource_group_name = local.resource_group_name
virtual_network_name = azurerm_virtual_network.network["staging"].name
remote_virtual_network_id = azurerm_virtual_network.network["test"].id
}

#Azure Virtual Network peering between Virtual Network testtostaging and stagingtotest
resource "azurerm_virtual_network_peering" "peeringconnection2" {
name = "testtostaging"
resource_group_name = local.resource_group_name
virtual_network_name = azurerm_virtual_network.network["test"].name
remote_virtual_network_id = azurerm_virtual_network.network["staging"].id
}

enter image description here

应用 Terraform 后,在两个 Vnet 上创建对等互连。

enter image description here

引用文档here了解更多。

关于使用 Terraform 运行时 Azure Vnet 对等互连启动状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74948296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com