From 6a614297685641ba8fe22804081d3d3db70cf8e3 Mon Sep 17 00:00:00 2001 From: Zach Trocinski Date: Wed, 20 Mar 2024 21:05:43 -0500 Subject: [PATCH] Adding conditional statements for subnet references --- infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep b/infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep index c7e0e1fd0..6b4f4d875 100644 --- a/infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep +++ b/infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep @@ -719,7 +719,7 @@ resource resBastionLock 'Microsoft.Authorization/locks@2020-05-01' = if (parAzBa } } -resource resGatewaySubnetRef 'Microsoft.Network/virtualNetworks/subnets@2023-02-01' existing = { +resource resGatewaySubnetRef 'Microsoft.Network/virtualNetworks/subnets@2023-02-01' existing = if (parVpnGatewayEnabled || parExpressRouteGatewayEnabled ) { parent: resHubVnet name: 'GatewaySubnet' } @@ -799,7 +799,7 @@ resource resVirtualNetworkGatewayLock 'Microsoft.Authorization/locks@2020-05-01' } }] -resource resAzureFirewallSubnetRef 'Microsoft.Network/virtualNetworks/subnets@2023-02-01' existing = { +resource resAzureFirewallSubnetRef 'Microsoft.Network/virtualNetworks/subnets@2023-02-01' existing = if (parAzFirewallEnabled) { parent: resHubVnet name: 'AzureFirewallSubnet' }