@@ -137,53 +137,14 @@ module nsg 'core/vnet/nsg.bicep' = {
137137 }
138138}
139139
140- resource vnet 'Microsoft.Network/virtualNetworks@2024-01-01' = {
141- name : '${abbrs .networkVirtualNetworks }${resourceBaseNameFinal }-deployment'
142- location : location
143- properties : {
144- addressSpace : {
145- addressPrefixes : [
146- '10.1.0.0/16'
147- ]
148- }
149- subnets : [
150- {
151- name : '${abbrs .networkVirtualNetworksSubnets }apim'
152- properties : {
153- addressPrefix : '10.1.0.0/24'
154- networkSecurityGroup : {
155- id : nsg .outputs .id
156- }
157- delegations : (apimTier == 'Developer' )
158- ? []
159- : [
160- {
161- name : 'Microsoft.Web/serverFarms'
162- properties : {
163- serviceName : 'Microsoft.Web/serverFarms'
164- }
165- }
166- ]
167- }
168- }
169- {
170- name : '${abbrs .networkVirtualNetworksSubnets }aks'
171- properties : {
172- addressPrefix : '10.1.1.0/24'
173- serviceEndpoints : [
174- {
175- service : 'Microsoft.Storage'
176- }
177- {
178- service : 'Microsoft.Sql'
179- }
180- {
181- service : 'Microsoft.EventHub'
182- }
183- ]
184- }
185- }
186- ]
140+ module vnet 'core/vnet/vnet.bicep' = {
141+ name : 'vnet-deployment'
142+ params : {
143+ vnetName : '${abbrs .networkVirtualNetworks }${resourceBaseNameFinal }'
144+ location : location
145+ subnetPrefix : abbrs .networkVirtualNetworksSubnets
146+ apimTier : apimTier
147+ nsgID : nsg .outputs .id
187148 }
188149}
189150
@@ -204,7 +165,7 @@ module aks 'core/aks/aks.bicep' = {
204165 graphragIndexingVMSize : 'standard_e8s_v5' // 8 vcpus, 64 GB memory
205166 clusterAdmins : !empty (deployerPrincipalId ) ? ['${deployerPrincipalId }' ] : null
206167 logAnalyticsWorkspaceId : log .outputs .id
207- subnetId : vnet .properties . subnets [ 1 ]. id // aks subnet
168+ subnetId : vnet .outputs . aksSubnetId
208169 privateDnsZoneName : privateDnsZone .outputs .name
209170 }
210171}
@@ -268,7 +229,7 @@ module apim 'core/apim/apim.bicep' = {
268229 availabilityZones : [] // TODO expose in param for premium sku
269230 publisherEmail : apiPublisherEmail
270231 publisherName : apiPublisherName
271- subnetId : vnet .properties . subnets [ 0 ]. id // apim subnet
232+ subnetId : vnet .outputs . apimSubnetId
272233 }
273234}
274235
@@ -300,7 +261,7 @@ module privateDnsZone 'core/vnet/private-dns-zone.bicep' = {
300261 params : {
301262 name : dnsDomain
302263 vnetNames : [
303- vnet .name
264+ vnet .outputs . vnetName // name
304265 ]
305266 }
306267}
@@ -309,7 +270,7 @@ module privatelinkPrivateDns 'core/vnet/privatelink-private-dns-zones.bicep' = i
309270 name : 'privatelink-private-dns-zones-deployment'
310271 params : {
311272 linkedVnetIds : [
312- vnet .id
273+ vnet .outputs . vnetId // id
313274 ]
314275 }
315276}
@@ -331,7 +292,7 @@ module cosmosDbPrivateEndpoint 'core/vnet/private-endpoint.bicep' = if (enablePr
331292 privateEndpointName : '${abbrs .privateEndpoint }cosmos-${cosmosdb .outputs .name }'
332293 location : location
333294 privateLinkServiceId : cosmosdb .outputs .id
334- subnetId : vnet .properties . subnets [ 1 ]. id // aks subnet
295+ subnetId : vnet .outputs . aksSubnetId
335296 groupId : 'Sql'
336297 privateDnsZoneConfigs : enablePrivateEndpoints ? privatelinkPrivateDns .outputs .cosmosDbPrivateDnsZoneConfigs : []
337298 }
@@ -343,7 +304,7 @@ module blobStoragePrivateEndpoint 'core/vnet/private-endpoint.bicep' = if (enabl
343304 privateEndpointName : '${abbrs .privateEndpoint }blob-${storage .outputs .name }'
344305 location : location
345306 privateLinkServiceId : storage .outputs .id
346- subnetId : vnet .properties . subnets [ 1 ]. id // aks subnet
307+ subnetId : vnet .outputs . aksSubnetId
347308 groupId : 'blob'
348309 privateDnsZoneConfigs : enablePrivateEndpoints ? privatelinkPrivateDns .outputs .blobStoragePrivateDnsZoneConfigs : []
349310 }
@@ -355,7 +316,7 @@ module aiSearchPrivateEndpoint 'core/vnet/private-endpoint.bicep' = if (enablePr
355316 privateEndpointName : '${abbrs .privateEndpoint }search-${aiSearch .outputs .name }'
356317 location : location
357318 privateLinkServiceId : aiSearch .outputs .id
358- subnetId : vnet .properties . subnets [ 1 ]. id // aks subnet
319+ subnetId : vnet .outputs . aksSubnetId
359320 groupId : 'searchService'
360321 privateDnsZoneConfigs : enablePrivateEndpoints ? privatelinkPrivateDns .outputs .aiSearchPrivateDnsZoneConfigs : []
361322 }
@@ -367,7 +328,7 @@ module privateLinkScopePrivateEndpoint 'core/vnet/private-endpoint.bicep' = if (
367328 privateEndpointName : '${abbrs .privateEndpoint }pls-${resourceBaseNameFinal }'
368329 location : location
369330 privateLinkServiceId : enablePrivateEndpoints ? azureMonitorPrivateLinkScope .outputs .id : ''
370- subnetId : vnet .properties . subnets [ 1 ]. id // aks subnet
331+ subnetId : vnet .outputs . aksSubnetId
371332 groupId : 'azuremonitor'
372333 privateDnsZoneConfigs : enablePrivateEndpoints ? privatelinkPrivateDns .outputs .azureMonitorPrivateDnsZoneConfigs : []
373334 }
0 commit comments