Skip to content

Commit 8a0f77b

Browse files
committed
update
1 parent b8761cb commit 8a0f77b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

main.tf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,36 @@ module "vnet_onprem" {
144144
tags = local.common_tags
145145
}
146146

147+
# -----------------------------------------------------------------------------
148+
# VNet Peering: Spoke1 <-> Spoke2 (for Route Server testing)
149+
# -----------------------------------------------------------------------------
150+
151+
resource "azurerm_virtual_network_peering" "spoke1_to_spoke2" {
152+
count = var.deploy.route_server ? 1 : 0
153+
154+
name = "peer-spoke1-to-spoke2"
155+
resource_group_name = azurerm_resource_group.this.name
156+
virtual_network_name = module.vnet_spoke1.name
157+
remote_virtual_network_id = module.vnet_spoke2.id
158+
allow_virtual_network_access = true
159+
allow_forwarded_traffic = true
160+
allow_gateway_transit = false
161+
use_remote_gateways = false
162+
}
163+
164+
resource "azurerm_virtual_network_peering" "spoke2_to_spoke1" {
165+
count = var.deploy.route_server ? 1 : 0
166+
167+
name = "peer-spoke2-to-spoke1"
168+
resource_group_name = azurerm_resource_group.this.name
169+
virtual_network_name = module.vnet_spoke2.name
170+
remote_virtual_network_id = module.vnet_spoke1.id
171+
allow_virtual_network_access = true
172+
allow_forwarded_traffic = true
173+
allow_gateway_transit = false
174+
use_remote_gateways = false
175+
}
176+
147177
# =============================================================================
148178
# PHASE 4: NETWORK SECURITY GROUPS (Before any VMs)
149179
# =============================================================================

0 commit comments

Comments
 (0)