Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expand usage of UDT for the AVNM Bicep Module - avm/res/network/network-manager #1584

Merged
merged 43 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
14f7ee7
Added UDT for AVNM, without security config
ahmadabdalla Apr 6, 2024
d68e5e8
Updated Security Admin rules
ahmadabdalla Apr 6, 2024
c489d29
Updated main
ahmadabdalla Apr 6, 2024
5a0fbd0
updated max test
ahmadabdalla Apr 6, 2024
73d81d9
update descriptions
ahmadabdalla Apr 6, 2024
195422a
added readme and JSON
ahmadabdalla Apr 6, 2024
93d54d8
Update README.md files with parameter descriptions
ahmadabdalla Apr 6, 2024
13463cf
Update version.json to 0.2
ahmadabdalla Apr 6, 2024
b130039
Merge branch 'main' into users/ahmad/AVNM_updates
ahmadabdalla Apr 6, 2024
4cbd1d1
Update parameter descriptions in README.md files
ahmadabdalla Apr 6, 2024
6a47288
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla Apr 9, 2024
07f35aa
Update avm/res/network/network-manager/connectivity-configuration/mai…
ahmadabdalla Apr 9, 2024
b6740fa
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla Apr 14, 2024
b9daec1
Refactor network manager connectivity configuration in main.json and …
ahmadabdalla Apr 14, 2024
864ecd1
feat: Update AVNM module versions and template hashes
ahmadabdalla Apr 14, 2024
8bbd54e
Merge remote-tracking branch 'origin/main' into users/ahmad/AVNM_updates
ahmadabdalla Apr 17, 2024
411efdf
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla Apr 17, 2024
7ee64b1
Updated UDT for Scope Type to be conditional and changed static membe…
ahmadabdalla Apr 17, 2024
8dbe421
cast strings
ahmadabdalla Apr 17, 2024
f5e8dae
Merge remote-tracking branch 'origin/main' into users/ahmad/AVNM_updates
ahmadabdalla Apr 26, 2024
7a80846
Merge remote-tracking branch 'origin/main' into users/ahmad/AVNM_upda…
ahmadabdalla May 11, 2024
5748fe3
feat: Update Azure Virtual Network Manager (AVNM) modules to version …
ahmadabdalla May 12, 2024
bac5f39
Merge remote-tracking branch 'origin/main' into users/ahmad/AVNM_updates
ahmadabdalla May 12, 2024
5782ff7
Merge branch 'users/ahmad/AVNM_updates' into users/ahmad/AVNM_updates…
ahmadabdalla May 12, 2024
afa8310
feat: Update Azure Virtual Network Manager (AVNM) modules to latest v…
ahmadabdalla May 12, 2024
46dccec
feat: Update network group name to 'network-group-spokes-1' in AVNM m…
ahmadabdalla May 12, 2024
1254d07
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla May 18, 2024
e11f848
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla May 18, 2024
df22ae7
Merge branch 'users/ahmad/AVNM_updates' into users/ahmad/AVNM_updates…
ahmadabdalla May 18, 2024
ad0480f
Update avm/res/network/network-manager/connectivity-configuration/mai…
ahmadabdalla May 18, 2024
2db9f98
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla May 20, 2024
d66ba5c
Merge branch 'users/ahmad/AVNM_updates' into users/ahmad/AVNM_updates…
ahmadabdalla May 20, 2024
e45394e
Update avm/res/network/network-manager/security-admin-configuration/r…
ahmadabdalla May 20, 2024
ae86044
Update avm/res/network/network-manager/security-admin-configuration/r…
ahmadabdalla May 20, 2024
50e9db5
Merge branch 'users/ahmad/AVNM_updates' into users/ahmad/AVNM_updates…
ahmadabdalla May 20, 2024
e213c86
Updated JSON
ahmadabdalla May 20, 2024
d317b70
feat: Update network group IDs in main.test.bicep
ahmadabdalla May 20, 2024
40f820f
Merge pull request #14 from ahmadabdalla/users/ahmad/AVNM_updates_SPIN
ahmadabdalla May 20, 2024
adc92bb
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla May 21, 2024
584de86
Update avm/res/network/network-manager/security-admin-configuration/r…
ahmadabdalla May 21, 2024
a1bf84e
Updated JSON
ahmadabdalla May 21, 2024
593faa9
Merge remote-tracking branch 'upstream/main' into users/ahmad/AVNM_up…
ahmadabdalla Jun 1, 2024
fe91204
feat: Update network group resource ID parameter names in security ad…
ahmadabdalla Jun 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
653 changes: 637 additions & 16 deletions avm/res/network/network-manager/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Connectivity configurations define hub-and-spoke or mesh topologies applied to o

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`appliesToGroups`](#parameter-appliestogroups) | array | Network Groups for the configuration. |
| [`appliesToGroups`](#parameter-appliestogroups) | array | Network Groups for the configuration. A connectivity configuration must be associated to at least one network group. |
| [`connectivityTopology`](#parameter-connectivitytopology) | string | Connectivity topology type. "Mesh" IS CURRENTLY A PREVIEW SERVICE/FEATURE, MICROSOFT MAY NOT PROVIDE SUPPORT FOR THIS, PLEASE CHECK THE PRODUCT DOCS FOR CLARIFICATION. |
| [`name`](#parameter-name) | string | The name of the connectivity configuration. |

Expand All @@ -44,11 +44,73 @@ Connectivity configurations define hub-and-spoke or mesh topologies applied to o

### Parameter: `appliesToGroups`

Network Groups for the configuration.
Network Groups for the configuration. A connectivity configuration must be associated to at least one network group.

- Required: No
- Required: Yes
- Type: array
- Default: `[]`

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`groupConnectivity`](#parameter-appliestogroupsgroupconnectivity) | string | Group connectivity type. |
| [`networkGroupId`](#parameter-appliestogroupsnetworkgroupid) | string | Network group Id. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`isGlobal`](#parameter-appliestogroupsisglobal) | string | Flag if global is supported. |
| [`useHubGateway`](#parameter-appliestogroupsusehubgateway) | string | Flag if use hub gateway. |

### Parameter: `appliesToGroups.groupConnectivity`

Group connectivity type.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'DirectlyConnected'
'None'
]
```

### Parameter: `appliesToGroups.networkGroupId`

Network group Id.

- Required: Yes
- Type: string

### Parameter: `appliesToGroups.isGlobal`

Flag if global is supported.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'False'
'True'
]
```

### Parameter: `appliesToGroups.useHubGateway`

Flag if use hub gateway.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'False'
'True'
]
```

### Parameter: `connectivityTopology`

Expand Down Expand Up @@ -77,7 +139,33 @@ List of hub items. This will create peerings between the specified hub and the v

- Required: No
- Type: array
- Default: `[]`

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`resourceId`](#parameter-hubsresourceid) | string | Resource Id of the hub. |
| [`resourceType`](#parameter-hubsresourcetype) | string | Resource type of the hub. |

### Parameter: `hubs.resourceId`

Resource Id of the hub.

- Required: Yes
- Type: string

### Parameter: `hubs.resourceType`

Resource type of the hub.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'Microsoft.Network/virtualNetworks'
]
```

### Parameter: `networkManagerName`

Expand Down Expand Up @@ -107,7 +195,6 @@ A description of the connectivity configuration.

- Required: No
- Type: string
- Default: `''`

### Parameter: `isGlobal`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ param name string

@maxLength(500)
@sys.description('Optional. A description of the connectivity configuration.')
param description string = ''
param description string?

@sys.description('Required. Network Groups for the configuration.')
param appliesToGroups array = []
@sys.description('Required. Network Groups for the configuration. A connectivity configuration must be associated to at least one network group.')
param appliesToGroups appliesToGroupsType

@allowed([
'HubAndSpoke'
Expand All @@ -25,7 +25,7 @@ param appliesToGroups array = []
param connectivityTopology string

@sys.description('Conditional. List of hub items. This will create peerings between the specified hub and the virtual networks in the network group specified. Required if connectivityTopology is of type "HubAndSpoke".')
param hubs array = []
param hubs hubsType

@allowed([
'True'
Expand All @@ -52,7 +52,7 @@ resource connectivityConfiguration 'Microsoft.Network/networkManagers/connectivi
appliesToGroups: appliesToGroups
connectivityTopology: connectivityTopology
deleteExistingPeering: connectivityTopology == 'HubAndSpoke' ? deleteExistingPeering : 'False'
description: description
description: description ?? ''
hubs: connectivityTopology == 'HubAndSpoke' ? hubs : []
isGlobal: isGlobal
}
Expand All @@ -66,3 +66,29 @@ output resourceId string = connectivityConfiguration.id

@sys.description('The resource group the connectivity configuration was deployed into.')
output resourceGroupName string = resourceGroup().name

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

type appliesToGroupsType = {
@sys.description('Required. Group connectivity type.')
groupConnectivity: ('DirectlyConnected' | 'None')

@sys.description('Optional. Flag if global is supported.')
isGlobal: ('True' | 'False')?

@sys.description('Required. Network group Id.')
networkGroupId: string

@sys.description('Optional. Flag if use hub gateway.')
useHubGateway: ('True' | 'False')?
}[]

type hubsType = {
@sys.description('Required. Resource Id of the hub.')
resourceId: string

@sys.description('Required. Resource type of the hub.')
resourceType: 'Microsoft.Network/virtualNetworks'
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
}[]?
106 changes: 93 additions & 13 deletions avm/res/network/network-manager/connectivity-configuration/main.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,89 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"languageVersion": "2.0",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.26.54.24096",
"templateHash": "3569964888966454016"
"version": "0.26.170.59819",
"templateHash": "730590109700461307"
},
"name": "Network Manager Connectivity Configurations",
"description": "This module deploys a Network Manager Connectivity Configuration.\nConnectivity configurations define hub-and-spoke or mesh topologies applied to one or more network groups.",
"owner": "Azure/module-maintainers"
},
"definitions": {
"appliesToGroupsType": {
"type": "array",
"items": {
"type": "object",
"properties": {
"groupConnectivity": {
"type": "string",
"allowedValues": [
"DirectlyConnected",
"None"
],
"metadata": {
"description": "Required. Group connectivity type."
}
},
"isGlobal": {
"type": "string",
"allowedValues": [
"False",
"True"
],
"nullable": true,
"metadata": {
"description": "Optional. Flag if global is supported."
}
},
"networkGroupId": {
"type": "string",
"metadata": {
"description": "Required. Network group Id."
}
},
"useHubGateway": {
"type": "string",
"allowedValues": [
"False",
"True"
],
"nullable": true,
"metadata": {
"description": "Optional. Flag if use hub gateway."
}
}
}
}
},
"hubsType": {
"type": "array",
"items": {
"type": "object",
"properties": {
"resourceId": {
"type": "string",
"metadata": {
"description": "Required. Resource Id of the hub."
}
},
"resourceType": {
"type": "string",
"allowedValues": [
"Microsoft.Network/virtualNetworks"
],
"metadata": {
"description": "Required. Resource type of the hub."
}
}
}
},
"nullable": true
}
},
"parameters": {
"networkManagerName": {
"type": "string",
Expand All @@ -27,17 +100,16 @@
},
"description": {
"type": "string",
"defaultValue": "",
"nullable": true,
"maxLength": 500,
"metadata": {
"description": "Optional. A description of the connectivity configuration."
}
},
"appliesToGroups": {
"type": "array",
"defaultValue": [],
"$ref": "#/definitions/appliesToGroupsType",
"metadata": {
"description": "Required. Network Groups for the configuration."
"description": "Required. Network Groups for the configuration. A connectivity configuration must be associated to at least one network group."
}
},
"connectivityTopology": {
Expand All @@ -51,8 +123,7 @@
}
},
"hubs": {
"type": "array",
"defaultValue": [],
"$ref": "#/definitions/hubsType",
"metadata": {
"description": "Conditional. List of hub items. This will create peerings between the specified hub and the virtual networks in the network group specified. Required if connectivityTopology is of type \"HubAndSpoke\"."
}
Expand Down Expand Up @@ -80,21 +151,30 @@
}
}
},
"resources": [
{
"resources": {
"networkManager": {
"existing": true,
"type": "Microsoft.Network/networkManagers",
"apiVersion": "2023-04-01",
"name": "[parameters('networkManagerName')]"
},
"connectivityConfiguration": {
"type": "Microsoft.Network/networkManagers/connectivityConfigurations",
"apiVersion": "2023-04-01",
"name": "[format('{0}/{1}', parameters('networkManagerName'), parameters('name'))]",
"properties": {
"appliesToGroups": "[parameters('appliesToGroups')]",
"connectivityTopology": "[parameters('connectivityTopology')]",
"deleteExistingPeering": "[if(equals(parameters('connectivityTopology'), 'HubAndSpoke'), parameters('deleteExistingPeering'), 'False')]",
"description": "[parameters('description')]",
"description": "[coalesce(parameters('description'), '')]",
"hubs": "[if(equals(parameters('connectivityTopology'), 'HubAndSpoke'), parameters('hubs'), createArray())]",
"isGlobal": "[parameters('isGlobal')]"
}
},
"dependsOn": [
"networkManager"
]
}
],
},
"outputs": {
"name": {
"type": "string",
Expand Down