This repository was archived by the owner on Jan 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathmain.express-route-gateway.tf
More file actions
44 lines (38 loc) · 1.86 KB
/
main.express-route-gateway.tf
File metadata and controls
44 lines (38 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module "express_route_gateways" {
source = "./modules/expressroute-gateway"
expressroute_gateways = {
for key, gw in local.expressroute_gateways : key => {
name = gw.name
resource_group_name = module.virtual_hubs.resource_object[gw.virtual_hub_key].resource_group
virtual_hub_id = module.virtual_hubs.resource_object[gw.virtual_hub_key].id
location = module.virtual_hubs.resource_object[gw.virtual_hub_key].location
scale_units = gw.scale_units
allow_non_virtual_wan_traffic = gw.allow_non_virtual_wan_traffic
tags = gw.tags
}
}
}
moved {
from = azurerm_express_route_gateway.express_route_gateway
to = module.express_route_gateways.azurerm_express_route_gateway.express_route_gateway
}
# Create the Express Route Connection
module "er_connections" {
source = "./modules/expressroute-gateway-conn"
er_circuit_connections = {
for key, conn in local.er_circuit_connections : key => {
name = conn.name
express_route_gateway_id = module.express_route_gateways.resource_object[conn.express_route_gateway_key].id
express_route_circuit_peering_id = conn.express_route_circuit_peering_id
authorization_key = try(conn.authorization_key, null)
enable_internet_security = try(conn.enable_internet_security, null)
express_route_gateway_bypass_enabled = try(conn.express_route_gateway_bypass_enabled, null)
routing = try(conn.routing, null)
routing_weight = try(conn.routing_weight, null)
}
}
}
moved {
from = azurerm_express_route_connection.er_connection
to = module.er_connections.azurerm_express_route_connection.er_connection
}