diff --git a/infra-as-code/bicep/modules/privateDnsZoneLinks/generateddocs/privateDnsZoneLinks.bicep.md b/infra-as-code/bicep/modules/privateDnsZoneLinks/generateddocs/privateDnsZoneLinks.bicep.md index fb48a8360..d8e1c9999 100644 --- a/infra-as-code/bicep/modules/privateDnsZoneLinks/generateddocs/privateDnsZoneLinks.bicep.md +++ b/infra-as-code/bicep/modules/privateDnsZoneLinks/generateddocs/privateDnsZoneLinks.bicep.md @@ -5,7 +5,7 @@ Parameter name | Required | Description -------------- | -------- | ----------- parSpokeVirtualNetworkResourceId | No | The Spoke Virtual Network Resource ID. -parPrivateDnsZoneResourceIds | No | The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. +parPrivateDnsZoneResourceId | No | The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. ### parSpokeVirtualNetworkResourceId @@ -13,7 +13,7 @@ parPrivateDnsZoneResourceIds | No | The Private DNS Zone Resource IDs to a The Spoke Virtual Network Resource ID. -### parPrivateDnsZoneResourceIds +### parPrivateDnsZoneResourceId ![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square) @@ -34,8 +34,8 @@ The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. "parSpokeVirtualNetworkResourceId": { "value": "" }, - "parPrivateDnsZoneResourceIds": { - "value": [] + "parPrivateDnsZoneResourceId": { + "value": "" } } } diff --git a/infra-as-code/bicep/modules/privateDnsZoneLinks/privateDnsZoneLinks.bicep b/infra-as-code/bicep/modules/privateDnsZoneLinks/privateDnsZoneLinks.bicep index 04dc2a7d5..b36c5e6fa 100644 --- a/infra-as-code/bicep/modules/privateDnsZoneLinks/privateDnsZoneLinks.bicep +++ b/infra-as-code/bicep/modules/privateDnsZoneLinks/privateDnsZoneLinks.bicep @@ -4,17 +4,17 @@ targetScope = 'resourceGroup' param parSpokeVirtualNetworkResourceId string = '' @sys.description('The Private DNS Zone Resource IDs to associate with the spoke Virtual Network.') -param parPrivateDnsZoneResourceIds array = [] +param parPrivateDnsZoneResourceId string = '' var varSpokeVirtualNetworkName = split(parSpokeVirtualNetworkResourceId, '/')[8] -resource resPrivateDnsZoneLinkToSpoke 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = [for zones in parPrivateDnsZoneResourceIds: if (!empty(parPrivateDnsZoneResourceIds)) { +resource resPrivateDnsZoneLinkToSpoke 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = if (!empty(parPrivateDnsZoneResourceId)) { location: 'global' - name: '${split(zones, '/')[8]}/dnslink-to-${varSpokeVirtualNetworkName}' + name: '${split(parPrivateDnsZoneResourceId, '/')[8]}/dnslink-to-${varSpokeVirtualNetworkName}' properties: { registrationEnabled: false virtualNetwork: { id: parSpokeVirtualNetworkResourceId } } -}] +} diff --git a/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/baseline.sample.bicep b/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/baseline.sample.bicep index 454834651..1e37ab360 100644 --- a/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/baseline.sample.bicep +++ b/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/baseline.sample.bicep @@ -14,7 +14,7 @@ targetScope = 'resourceGroup' param parSpokeVirtualNetworkResourceId string = '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups//providers/Microsoft.Network/virtualNetworks/' @sys.description('The Private DNS Zone Resource IDs to associate with the spoke Virtual Network.') -param parPrivateDnsZoneResourceIds array = [] +param parPrivateDnsZoneResourceId string = '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups//providers/Microsoft.Network/privateDnsZones/' // --------- // RESOURCES @@ -24,7 +24,7 @@ param parPrivateDnsZoneResourceIds array = [] module baseline_private_dns_zone_linking '../privateDnsZoneLinks.bicep' = { name: 'baseline_vnet_peering' params: { - parPrivateDnsZoneResourceIds: parPrivateDnsZoneResourceIds + parPrivateDnsZoneResourceId: parPrivateDnsZoneResourceId parSpokeVirtualNetworkResourceId: parSpokeVirtualNetworkResourceId } } diff --git a/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/generateddocs/baseline.sample.bicep.md b/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/generateddocs/baseline.sample.bicep.md index 7566b3f32..0c45d774b 100644 --- a/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/generateddocs/baseline.sample.bicep.md +++ b/infra-as-code/bicep/modules/privateDnsZoneLinks/samples/generateddocs/baseline.sample.bicep.md @@ -5,7 +5,7 @@ Parameter name | Required | Description -------------- | -------- | ----------- parSpokeVirtualNetworkResourceId | No | The Spoke Virtual Network Resource ID. -parPrivateDnsZoneResourceIds | No | The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. +parPrivateDnsZoneResourceId | No | The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. ### parSpokeVirtualNetworkResourceId @@ -15,12 +15,14 @@ The Spoke Virtual Network Resource ID. - Default value: `/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups//providers/Microsoft.Network/virtualNetworks/` -### parPrivateDnsZoneResourceIds +### parPrivateDnsZoneResourceId ![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square) The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. +- Default value: `/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups//providers/Microsoft.Network/privateDnsZones/` + ## Snippets ### Parameter file @@ -36,8 +38,8 @@ The Private DNS Zone Resource IDs to associate with the spoke Virtual Network. "parSpokeVirtualNetworkResourceId": { "value": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups//providers/Microsoft.Network/virtualNetworks/" }, - "parPrivateDnsZoneResourceIds": { - "value": [] + "parPrivateDnsZoneResourceId": { + "value": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups//providers/Microsoft.Network/privateDnsZones/" } } } diff --git a/infra-as-code/bicep/orchestration/hubPeeredSpoke/hubPeeredSpoke.bicep b/infra-as-code/bicep/orchestration/hubPeeredSpoke/hubPeeredSpoke.bicep index 5086a3b77..c1add438d 100644 --- a/infra-as-code/bicep/orchestration/hubPeeredSpoke/hubPeeredSpoke.bicep +++ b/infra-as-code/bicep/orchestration/hubPeeredSpoke/hubPeeredSpoke.bicep @@ -160,11 +160,11 @@ module modSpokeNetworking '../../modules/spokeNetworking/spokeNetworking.bicep' } // Module - Private DNS Zone Virtual Network Link to Spoke -module modPrivateDnsZoneLinkToSpoke '../../modules/privateDnsZoneLinks/privateDnsZoneLinks.bicep' = [for zones in parPrivateDnsZoneResourceIds: if (!empty(parPrivateDnsZoneResourceIds)) { - scope: resourceGroup(split(zones, '/')[1], split(zones, '/')[4] ) - name: take('${varModuleDeploymentNames.modPrivateDnsZoneLinkToSpoke}-${uniqueString(zones)}', 64) +module modPrivateDnsZoneLinkToSpoke '../../modules/privateDnsZoneLinks/privateDnsZoneLinks.bicep' = [for zone in parPrivateDnsZoneResourceIds: if (!empty(parPrivateDnsZoneResourceIds)) { + scope: resourceGroup(split(zone, '/')[2], split(zone, '/')[4] ) + name: take('${varModuleDeploymentNames.modPrivateDnsZoneLinkToSpoke}-${uniqueString(zone)}', 64) params: { - parPrivateDnsZoneResourceIds: parPrivateDnsZoneResourceIds + parPrivateDnsZoneResourceId: zone parSpokeVirtualNetworkResourceId: modSpokeNetworking.outputs.outSpokeVirtualNetworkId } }]