你能告诉我这是窃听器还是我搞错了?我想创建一个带有新订阅的快速路由连接,如果我将通过Azure GUI控制台运行良好,但通过terraform (应用阶段)失败。在terraform计划中(成功地运行),我正确地看到了所有的输入值,但是我在下面得到了这个错误。有人知道发生了什么吗?
代码:
resource "azurerm_virtual_network_gateway_connection" "express_route_circuit_connection" {
name = "az-prd-euw-expressrouteconn-001"
location = azurerm_resource_group.resource_group.location
resource_group_name = azurerm_resource_group.resource_group.name
type = "ExpressRoute"
virtual_network_gateway_id = azurerm_virtual_network_gateway.disaster_recovery_virtual_network_gateway.id
peer_virtual_network_gateway_id = data.azurerm_express_route_circuit.express_route_circuit.id
authorization_key = azurerm_express_route_circuit_authorization.marel-disasterrecovery.authorization_key
routing_weight = 1
}地形平面图阶段
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.disaster_recovery.azurerm_virtual_network_gateway_connection.express_route_circuit_connection will be created
+ resource "azurerm_virtual_network_gateway_connection" "express_route_circuit_connection" {
+ authorization_key = (sensitive value)
+ connection_mode = "Default"
+ connection_protocol = (known after apply)
+ enable_bgp = (known after apply)
+ express_route_gateway_bypass = (known after apply)
+ id = (known after apply)
+ location = "westeurope"
+ name = "***********-expressrouteconn-001"
+ peer_virtual_network_gateway_id = "/subscriptions/***********/resourceGroups/***********-rg-001/providers/Microsoft.Network/expressRouteCircuits/***********-001"
+ resource_group_name = "***********-rg-001"
+ routing_weight = 1
+ type = "ExpressRoute"
+ use_policy_based_traffic_selectors = (known after apply)
+ virtual_network_gateway_id = "/subscriptions/***********/resourceGroups/***********-rg-001/providers/Microsoft.Network/virtualNetworkGateways/***********-vgw-001"
}遵循错误消息:
module.disaster_recovery.azurerm_virtual_network_gateway_connection.express_route_circuit_connection: Creating...
╷
│ Error: ID was missing the `virtualNetworkGateways` element
│
│ with module.disaster_recovery.azurerm_virtual_network_gateway_connection.express_route_circuit_connection,
│ on modules/disaster-recovery/network.tf line 118, in resource "azurerm_virtual_network_gateway_connection" "express_route_circuit_connection":
│ 118: resource "azurerm_virtual_network_gateway_connection" "express_route_circuit_connection" {
│你能帮我解决这个奇怪的问题吗?我真的很感激你的帮助和时间
致以敬意,
发布于 2022-07-08 07:05:03
解决上述问题的方法之一,您可以遵循;
您使用的类型是ExpressRoute,在使用此类型时,需要传递而不是,因为当类型为Vnet2Vnet时使用。
例如:-
gateway_connection_type = "ExpressRoute"
express_route_circuit_id = var.express_route_circuit_id欲知详情,请参阅以下连结:-
@kumarvna.提供模块详细信息的
https://stackoverflow.com/questions/72825870
复制相似问题