Skip to content

Commit

Permalink
Merge branch 'main' into v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Box committed Jun 15, 2024
2 parents 236e3cb + 92106de commit 0e9d5c3
Show file tree
Hide file tree
Showing 42 changed files with 256 additions and 130 deletions.
36 changes: 35 additions & 1 deletion avm/res/container-registry/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,14 @@ module registry 'br/public:avm/res/container-registry/registry:<version>' = {
]
exportPolicyStatus: 'enabled'
location: '<location>'
privateEndpoints: [
{
privateDnsZoneResourceIds: [
'<privateDNSResourceId>'
]
subnetResourceId: '<subnetResourceId>'
}
]
quarantinePolicyStatus: 'enabled'
replications: [
{
Expand Down Expand Up @@ -546,6 +554,16 @@ module registry 'br/public:avm/res/container-registry/registry:<version>' = {
"location": {
"value": "<location>"
},
"privateEndpoints": {
"value": [
{
"privateDnsZoneResourceIds": [
"<privateDNSResourceId>"
],
"subnetResourceId": "<subnetResourceId>"
}
]
},
"quarantinePolicyStatus": {
"value": "enabled"
},
Expand Down Expand Up @@ -1048,6 +1066,8 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | string | The name of the private endpoint. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | string | The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | array | The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
| [`privateLinkServiceConnectionName`](#parameter-privateendpointsprivatelinkserviceconnectionname) | string | The name of the private link connection to create. |
| [`resourceGroupName`](#parameter-privateendpointsresourcegroupname) | string | Specify if you want to deploy the Private Endpoint into a different resource group than the main resource. |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | array | Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | string | The subresource to deploy the private endpoint for. For example "vault", "mysqlServer" or "dataFactory". |
| [`tags`](#parameter-privateendpointstags) | object | Tags to be applied on all resources/resource groups in this deployment. |
Expand Down Expand Up @@ -1243,6 +1263,20 @@ The private DNS zone groups to associate the private endpoint with. A DNS zone g
- Required: No
- Type: array

### Parameter: `privateEndpoints.privateLinkServiceConnectionName`

The name of the private link connection to create.

- Required: No
- Type: string

### Parameter: `privateEndpoints.resourceGroupName`

Specify if you want to deploy the Private Endpoint into a different resource group than the main resource.

- Required: No
- Type: string

### Parameter: `privateEndpoints.roleAssignments`

Array of role assignments to create.
Expand Down Expand Up @@ -1579,7 +1613,7 @@ This section gives you an overview of all local-referenced module files (i.e., o

| Reference | Type |
| :-- | :-- |
| `br/public:avm/res/network/private-endpoint:0.4.0` | Remote reference |
| `br/public:avm/res/network/private-endpoint:0.4.1` | Remote reference |

## Data Collection

Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/cache-rules/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "17108035841365544326"
"version": "0.27.1.19265",
"templateHash": "15228477210534278013"
},
"name": "Container Registries Cache",
"description": "Cache for Azure Container Registry (Preview) feature allows users to cache container images in a private container registry. Cache for ACR, is a preview feature available in Basic, Standard, and Premium service tiers ([ref](https://learn.microsoft.com/en-us/azure/container-registry/tutorial-registry-cache)).",
Expand Down
35 changes: 22 additions & 13 deletions avm/res/container-registry/registry/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -401,23 +401,26 @@ resource registry_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-
}
]

module registry_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.4.0' = [
module registry_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.4.1' = [
for (privateEndpoint, index) in (privateEndpoints ?? []): {
name: '${uniqueString(deployment().name, location)}-registry-PrivateEndpoint-${index}'
scope: resourceGroup(privateEndpoint.?resourceGroupName ?? '')
params: {
name: privateEndpoint.?name ?? 'pep-${last(split(registry.id, '/'))}-${privateEndpoint.?service ?? 'registry'}-${index}'
privateLinkServiceConnections: [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(registry.id, '/'))}-${privateEndpoint.?service ?? 'registry'}-${index}'
properties: {
privateLinkServiceId: registry.id
groupIds: [
privateEndpoint.?service ?? 'registry'
]
}
}
]
manualPrivateLinkServiceConnections: privateEndpoint.?manualPrivateLinkServiceConnections == true
privateLinkServiceConnections: privateEndpoint.?isManualConnection != true
? [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(registry.id, '/'))}-${privateEndpoint.?service ?? 'registry'}-${index}'
properties: {
privateLinkServiceId: registry.id
groupIds: [
privateEndpoint.?service ?? 'registry'
]
}
}
]
: null
manualPrivateLinkServiceConnections: privateEndpoint.?isManualConnection == true
? [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(registry.id, '/'))}-${privateEndpoint.?service ?? 'registry'}-${index}'
Expand Down Expand Up @@ -519,6 +522,9 @@ type privateEndpointType = {
@description('Optional. The location to deploy the private endpoint to.')
location: string?

@description('Optional. The name of the private link connection to create.')
privateLinkServiceConnectionName: string?

@description('Optional. The subresource to deploy the private endpoint for. For example "vault", "mysqlServer" or "dataFactory".')
service: string?

Expand Down Expand Up @@ -582,6 +588,9 @@ type privateEndpointType = {

@description('Optional. Enable/Disable usage telemetry for module.')
enableTelemetry: bool?

@description('Optional. Specify if you want to deploy the Private Endpoint into a different resource group than the main resource.')
resourceGroupName: string?
}[]?

type diagnosticSettingType = {
Expand Down
43 changes: 23 additions & 20 deletions avm/res/container-registry/registry/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.27.1.19265",
"templateHash": "10889694252440800848"
"templateHash": "14288249811607679009"
},
"name": "Azure Container Registries (ACR)",
"description": "This module deploys an Azure Container Registry (ACR).",
Expand Down Expand Up @@ -146,6 +146,13 @@
"description": "Optional. The location to deploy the private endpoint to."
}
},
"privateLinkServiceConnectionName": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name of the private link connection to create."
}
},
"service": {
"type": "string",
"nullable": true,
Expand Down Expand Up @@ -305,6 +312,13 @@
"metadata": {
"description": "Optional. Enable/Disable usage telemetry for module."
}
},
"resourceGroupName": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. Specify if you want to deploy the Private Endpoint into a different resource group than the main resource."
}
}
}
},
Expand Down Expand Up @@ -1399,6 +1413,7 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('{0}-registry-PrivateEndpoint-{1}', uniqueString(deployment().name, parameters('location')), copyIndex())]",
"resourceGroup": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'resourceGroupName'), '')]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
Expand All @@ -1408,20 +1423,8 @@
"name": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'name'), format('pep-{0}-{1}-{2}', last(split(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '/')), coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry'), copyIndex()))]"
},
"privateLinkServiceConnections": {
"value": [
{
"name": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'privateLinkServiceConnectionName'), format('{0}-{1}-{2}', last(split(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '/')), coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry'), copyIndex()))]",
"properties": {
"privateLinkServiceId": "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]",
"groupIds": [
"[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry')]"
]
}
}
]
},
"manualPrivateLinkServiceConnections": "[if(equals(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualPrivateLinkServiceConnections'), true()), createObject('value', createArray(createObject('name', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'privateLinkServiceConnectionName'), format('{0}-{1}-{2}', last(split(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '/')), coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry'), copyIndex())), 'properties', createObject('privateLinkServiceId', resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), 'groupIds', createArray(coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry')), 'requestMessage', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualConnectionRequestMessage'), 'Manual approval required.'))))), createObject('value', null()))]",
"privateLinkServiceConnections": "[if(not(equals(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'isManualConnection'), true())), createObject('value', createArray(createObject('name', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'privateLinkServiceConnectionName'), format('{0}-{1}-{2}', last(split(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '/')), coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry'), copyIndex())), 'properties', createObject('privateLinkServiceId', resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), 'groupIds', createArray(coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry')))))), createObject('value', null()))]",
"manualPrivateLinkServiceConnections": "[if(equals(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'isManualConnection'), true()), createObject('value', createArray(createObject('name', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'privateLinkServiceConnectionName'), format('{0}-{1}-{2}', last(split(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '/')), coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry'), copyIndex())), 'properties', createObject('privateLinkServiceId', resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), 'groupIds', createArray(coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'service'), 'registry')), 'requestMessage', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualConnectionRequestMessage'), 'Manual approval required.'))))), createObject('value', null()))]",
"subnetResourceId": {
"value": "[coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].subnetResourceId]"
},
Expand Down Expand Up @@ -1466,8 +1469,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "2592884001616184297"
"version": "0.25.53.49325",
"templateHash": "4120048060064073955"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
Expand Down Expand Up @@ -1832,7 +1835,7 @@
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"name": "[format('46d3xbcp.res.network-privateendpoint.{0}.{1}', replace('0.4.0', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"name": "[format('46d3xbcp.res.network-privateendpoint.{0}.{1}', replace('0.4.1', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
Expand Down Expand Up @@ -1937,8 +1940,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "9321937464667207030"
"version": "0.25.53.49325",
"templateHash": "11244630631275470040"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/replication/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "16451316437757175736"
"version": "0.27.1.19265",
"templateHash": "17370607380629293508"
},
"name": "Azure Container Registry (ACR) Replications",
"description": "This module deploys an Azure Container Registry (ACR) Replication.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,5 @@ module testDeployment '../../../main.bicep' = [
]
}
}
dependsOn: [
nestedDependencies
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,5 @@ module testDeployment '../../../main.bicep' = [
Role: 'DeploymentValidation'
}
}
dependsOn: [
nestedDependencies
diagnosticDependencies
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,47 @@ param managedIdentityName string
@description('Required. The name of the Deployment Script to create to get the paired region name.')
param pairedRegionScriptName string

@description('Required. The name of the Virtual Network to create.')
param virtualNetworkName string

var addressPrefix = '10.0.0.0/16'

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-04-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
addressPrefix
]
}
subnets: [
{
name: 'defaultSubnet'
properties: {
addressPrefix: cidrSubnet(addressPrefix, 16, 0)
}
}
]
}
}

resource privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
name: 'privatelink${environment().suffixes.acrLoginServer}'
location: 'global'

resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = {
name: '${virtualNetwork.name}-vnetlink'
location: 'global'
properties: {
virtualNetwork: {
id: virtualNetwork.id
}
registrationEnabled: false
}
}
}

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managedIdentityName
location: location
Expand Down Expand Up @@ -47,3 +88,9 @@ resource getPairedRegionScript 'Microsoft.Resources/deploymentScripts@2020-10-01

@description('The name of the paired region.')
output pairedRegionName string = getPairedRegionScript.properties.outputs.pairedRegionName

@description('The resource ID of the created Virtual Network Subnet.')
output subnetResourceId string = virtualNetwork.properties.subnets[0].id

@description('The resource ID of the created Private DNS Zone.')
output privateDNSResourceId string = privateDNSZone.id
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module nestedDependencies 'dependencies.bicep' = {
params: {
location: resourceLocation
managedIdentityName: 'dep-${namePrefix}-msi-ds-${serviceShort}'
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
pairedRegionScriptName: 'dep-${namePrefix}-ds-${serviceShort}'
}
}
Expand Down Expand Up @@ -94,10 +95,14 @@ module testDeployment '../../../main.bicep' = [
Environment: 'Non-Prod'
Role: 'DeploymentValidation'
}
privateEndpoints: [
{
privateDnsZoneResourceIds: [
nestedDependencies.outputs.privateDNSResourceId
]
subnetResourceId: nestedDependencies.outputs.subnetResourceId
}
]
}
dependsOn: [
nestedDependencies
diagnosticDependencies
]
}
]
2 changes: 1 addition & 1 deletion avm/res/container-registry/registry/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.2",
"version": "0.3",
"pathFilters": [
"./main.json"
]
Expand Down
4 changes: 2 additions & 2 deletions avm/res/container-registry/registry/webhook/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "10731035117081750792"
"version": "0.27.1.19265",
"templateHash": "12261942841024526503"
},
"name": "Azure Container Registry (ACR) Webhooks",
"description": "This module deploys an Azure Container Registry (ACR) Webhook.",
Expand Down
9 changes: 8 additions & 1 deletion avm/res/desktop-virtualization/scaling-plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This module deploys an Azure Virtual Desktop Scaling Plan.
| :-- | :-- |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.DesktopVirtualization/scalingPlans` | [2022-09-09](https://learn.microsoft.com/en-us/azure/templates/Microsoft.DesktopVirtualization/2022-09-09/scalingPlans) |
| `Microsoft.DesktopVirtualization/scalingPlans` | [2023-09-05](https://learn.microsoft.com/en-us/azure/templates/Microsoft.DesktopVirtualization/2023-09-05/scalingPlans) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |

## Usage examples
Expand Down Expand Up @@ -735,6 +735,13 @@ Host pool type of the Scaling Plan.
- Required: No
- Type: string
- Default: `'Pooled'`
- Allowed:
```Bicep
[
'Personal'
'Pooled'
]
```

### Parameter: `location`

Expand Down
Loading

0 comments on commit 0e9d5c3

Please sign in to comment.