我想知道是否有人可以帮助我使用 Terraform 在 Azure 中跨订阅设置 Vnet 对等互连。每个订阅都在同一个租户中,但它们具有不同的服务主体。我不断收到错误消息,提示服务主体看不到其他订阅中的资源组。尽管授予该服务主体贡献者访问其他订阅的权限。
这是我拥有的代码示例:
resource "azurerm_virtual_network_peering" "dev-to-test" {
name = "dev-to-test"
resource_group_name = "gl-dev-rg"
virtual_network_name = "gl-dev-vnet"
remote_virtual_network_id = "/subscriptions/subscriptionid/resourceGroups/gl-test-rg/providers/Microsoft.Network/virtualNetworks/gl-test-vnet"
allow_virtual_network_access = true
allow_forwarded_traffic = true
}
resource "azurerm_virtual_network_peering" "test-to-dev" {
name = "test-to-dev"
resource_group_name = "gl-test-rg"
virtual_network_name = "gl-test-vnet"
remote_virtual_network_id = "/subscriptions/subscriptionid/resourceGroups/gl-dev-rg/providers/Microsoft.Network/virtualNetworks/gl-dev-vnet"
allow_virtual_network_access = true
allow_forwarded_traffic = true
}
任何帮助将非常感激!
更多信息可以在这里找到: https ://github.com/terraform-providers/terraform-provider-azurerm/issues/1253