Skip to content

Commit

Permalink
feat: Virtual-Wan - Update to latest UDTs (#4339)
Browse files Browse the repository at this point in the history
## Description

Update to latest UDTs

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.network.virtual-wan](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.virtual-wan.yml/badge.svg?branch=users%2Falsehr%2FvwanUDT&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.virtual-wan.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation
  • Loading branch information
AlexanderSehr authored Jan 29, 2025
1 parent 7443b6a commit 109bfbe
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 145 deletions.
25 changes: 9 additions & 16 deletions avm/res/network/virtual-wan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This module deploys a Virtual WAN.
- [Usage examples](#Usage-examples)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)
- [Data Collection](#Data-Collection)

## Resource Types
Expand Down Expand Up @@ -43,10 +44,7 @@ This instance deploys the module with the minimum set of required parameters.
module virtualWan 'br/public:avm/res/network/virtual-wan:<version>' = {
name: 'virtualWanDeployment'
params: {
// Required parameters
name: 'nvwmin001'
// Non-required parameters
location: '<location>'
}
}
```
Expand All @@ -63,13 +61,8 @@ module virtualWan 'br/public:avm/res/network/virtual-wan:<version>' = {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"name": {
"value": "nvwmin001"
},
// Non-required parameters
"location": {
"value": "<location>"
}
}
}
Expand All @@ -85,10 +78,7 @@ module virtualWan 'br/public:avm/res/network/virtual-wan:<version>' = {
```bicep-params
using 'br/public:avm/res/network/virtual-wan:<version>'
// Required parameters
param name = 'nvwmin001'
// Non-required parameters
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -287,7 +277,6 @@ module virtualWan 'br/public:avm/res/network/virtual-wan:<version>' = {
allowBranchToBranchTraffic: true
allowVnetToVnetTraffic: true
disableVpnEncryption: true
location: '<location>'
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Expand Down Expand Up @@ -324,9 +313,6 @@ module virtualWan 'br/public:avm/res/network/virtual-wan:<version>' = {
"disableVpnEncryption": {
"value": true
},
"location": {
"value": "<location>"
},
"tags": {
"value": {
"Environment": "Non-Prod",
Expand Down Expand Up @@ -357,7 +343,6 @@ param name = 'nvwwaf001'
param allowBranchToBranchTraffic = true
param allowVnetToVnetTraffic = true
param disableVpnEncryption = true
param location = '<location>'
param tags = {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Expand Down Expand Up @@ -609,6 +594,14 @@ The type of the Virtual WAN.
| `resourceGroupName` | string | The resource group the virtual WAN was deployed into. |
| `resourceId` | string | The resource ID of the virtual WAN. |

## Cross-referenced modules

This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).

| Reference | Type |
| :-- | :-- |
| `br/public:avm/utl/types/avm-common-types:0.5.1` | Remote reference |

## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
44 changes: 4 additions & 40 deletions avm/res/network/virtual-wan/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ param allowVnetToVnetTraffic bool = false
@description('Optional. VPN encryption to be disabled or not.')
param disableVpnEncryption bool = false

import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'
@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
param roleAssignments roleAssignmentType[]?

@description('Optional. Tags of the resource.')
param tags object?

@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'
@description('Optional. The lock settings of the service.')
param lock lockType
param lock lockType?

var builtInRoleNames = {
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
Expand Down Expand Up @@ -133,41 +135,3 @@ output resourceGroupName string = resourceGroup().name

@description('The location the resource was deployed into.')
output location string = virtualWan.location

// =============== //
// Definitions //
// =============== //

type lockType = {
@description('Optional. Specify the name of lock.')
name: string?

@description('Optional. Specify the type of lock.')
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}?

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?
156 changes: 84 additions & 72 deletions avm/res/network/virtual-wan/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "1804376984077003732"
"version": "0.33.13.18514",
"templateHash": "17894213695332592187"
},
"name": "Virtual WANs",
"description": "This module deploys a Virtual WAN."
Expand Down Expand Up @@ -35,80 +35,87 @@
}
}
},
"nullable": true
"metadata": {
"description": "An AVM-aligned type for a lock.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.5.1"
}
}
},
"roleAssignmentType": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
}
},
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
}
},
"principalType": {
"type": "string",
"allowedValues": [
"Device",
"ForeignGroup",
"Group",
"ServicePrincipal",
"User"
],
"nullable": true,
"metadata": {
"description": "Optional. The principal type of the assigned principal ID."
}
},
"description": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The description of the role assignment."
}
},
"condition": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
}
},
"conditionVersion": {
"type": "string",
"allowedValues": [
"2.0"
],
"nullable": true,
"metadata": {
"description": "Optional. Version of the condition."
}
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The Resource Id of the delegated managed identity resource."
}
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
}
},
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
}
},
"principalType": {
"type": "string",
"allowedValues": [
"Device",
"ForeignGroup",
"Group",
"ServicePrincipal",
"User"
],
"nullable": true,
"metadata": {
"description": "Optional. The principal type of the assigned principal ID."
}
},
"description": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The description of the role assignment."
}
},
"condition": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
}
},
"conditionVersion": {
"type": "string",
"allowedValues": [
"2.0"
],
"nullable": true,
"metadata": {
"description": "Optional. Version of the condition."
}
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The Resource Id of the delegated managed identity resource."
}
}
},
"nullable": true
"metadata": {
"description": "An AVM-aligned type for a role assignment.",
"__bicep_imported_from!": {
"sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.5.1"
}
}
}
},
"parameters": {
Expand Down Expand Up @@ -158,7 +165,11 @@
}
},
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"type": "array",
"items": {
"$ref": "#/definitions/roleAssignmentType"
},
"nullable": true,
"metadata": {
"description": "Optional. Array of role assignments to create."
}
Expand All @@ -179,6 +190,7 @@
},
"lock": {
"$ref": "#/definitions/lockType",
"nullable": true,
"metadata": {
"description": "Optional. The lock settings of the service."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module testDeployment '../../../main.bicep' = [
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: resourceLocation
}
}
]
3 changes: 0 additions & 3 deletions avm/res/network/virtual-wan/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,5 @@ module testDeployment '../../../main.bicep' = [
Role: 'DeploymentValidation'
}
}
dependsOn: [
nestedDependencies
]
}
]
13 changes: 0 additions & 13 deletions avm/res/network/virtual-wan/tests/e2e/waf-aligned/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: resourceLocation
}
}

// ============== //
// Test Execution //
// ============== //
Expand All @@ -50,7 +41,6 @@ module testDeployment '../../../main.bicep' = [
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: resourceLocation
name: '${namePrefix}${serviceShort}001'
allowBranchToBranchTraffic: true
allowVnetToVnetTraffic: true
Expand All @@ -62,8 +52,5 @@ module testDeployment '../../../main.bicep' = [
Role: 'DeploymentValidation'
}
}
dependsOn: [
nestedDependencies
]
}
]

0 comments on commit 109bfbe

Please sign in to comment.