Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9b45d1e
[Modules] Updated Network/VPNSites to new dependency approach
AlexanderSehr Aug 30, 2022
277cb85
Merge branch 'main' into users/alsehr/1791_Network_VPNSites
AlexanderSehr Sep 1, 2022
e38cab8
Update to latest
AlexanderSehr Sep 1, 2022
9a363d4
Merge branch 'main' into users/alsehr/1791_Network_VPNSites
AlexanderSehr Sep 2, 2022
ebad423
Updated folder default to common.
AlexanderSehr Sep 8, 2022
a593967
Merge branch 'main' into users/alsehr/1791_Network_VPNSites
AlexanderSehr Sep 9, 2022
4dae77c
Update to latest
AlexanderSehr Sep 9, 2022
feb6403
Update to latest
AlexanderSehr Sep 9, 2022
010431a
Update to latest
AlexanderSehr Sep 9, 2022
173e329
Update modules/Microsoft.Network/vpnSites/.test/common/deploy.test.bicep
AlexanderSehr Sep 19, 2022
5408471
Update modules/Microsoft.Network/vpnSites/.test/min/deploy.test.bicep
AlexanderSehr Sep 19, 2022
2178336
Merge branch 'main' into users/alsehr/1791_Network_VPNSites
AlexanderSehr Sep 28, 2022
e205151
Update to latest
AlexanderSehr Sep 28, 2022
9dc040a
Update modules/Microsoft.Network/vpnSites/.test/common/dependencies.b…
AlexanderSehr Sep 29, 2022
c9eeba5
Update modules/Microsoft.Network/vpnSites/.test/min/deploy.test.bicep
AlexanderSehr Sep 29, 2022
12e6e47
Update modules/Microsoft.Network/vpnSites/.test/common/deploy.test.bicep
AlexanderSehr Sep 29, 2022
7edf44f
Update modules/Microsoft.Network/vpnSites/.test/common/dependencies.b…
AlexanderSehr Sep 29, 2022
8b6a69f
Update modules/Microsoft.Network/vpnSites/.test/min/deploy.test.bicep
AlexanderSehr Sep 29, 2022
470fe7c
Update modules/Microsoft.Network/vpnSites/.test/common/deploy.test.bicep
AlexanderSehr Sep 29, 2022
55da4df
Merge branch 'main' into users/alsehr/1791_Network_VPNSites
AlexanderSehr Sep 29, 2022
a38b0dc
Updated readme
AlexanderSehr Sep 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ms.network.vpnsites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ jobs:
- name: 'Using test file [${{ matrix.moduleTestFilePaths }}]'
uses: ./.github/actions/templates/validateModuleDeployment
with:
templateFilePath: '${{ env.modulePath }}/deploy.bicep'
parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}'
location: '${{ env.location }}'
resourceGroupName: '${{ env.resourceGroupName }}'
subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@description('Required. The name of the managed identity to create.')
param managedIdentityName string

@description('Required. The name of the virtual WAN to create.')
param virtualWANName string

@description('Optional. The location to deploy resources to.')
param location string = resourceGroup().location

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
name: managedIdentityName
location: location
}

resource virtualWan 'Microsoft.Network/virtualWans@2021-05-01' = {
name: virtualWANName
location: location
}

@description('The principal ID of the created managed identity.')
output managedIdentityPrincipalId string = managedIdentity.properties.principalId

@description('The resource ID of the created Virtual WAN.')
output virtualWWANResourceId string = virtualWan.id
100 changes: 100 additions & 0 deletions modules/Microsoft.Network/vpnSites/.test/common/deploy.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(80)
param resourceGroupName string = 'ms.network.vpnSites-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'nvscom'

// =========== //
// Deployments //
// =========== //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
}

module resourceGroupResources 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-paramNested'
params: {
managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}'
virtualWANName: 'dep-<<namePrefix>>-vw-${serviceShort}'
}
}

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
name: '<<namePrefix>>-${serviceShort}'
virtualWanId: resourceGroupResources.outputs.virtualWWANResourceId
lock: 'CanNotDelete'
tags: {
tagA: 'valueA'
tagB: 'valueB'
}
deviceProperties: {
linkSpeedInMbps: 0
}
vpnSiteLinks: [
{
name: '<<namePrefix>>-vSite-${serviceShort}'
properties: {
bgpProperties: {
asn: 65010
bgpPeeringAddress: '1.1.1.1'
}
ipAddress: '1.2.3.4'
linkProperties: {
linkProviderName: 'contoso'
linkSpeedInMbps: 5
}
}
}
{
name: 'Link1'
properties: {
bgpProperties: {
asn: 65020
bgpPeeringAddress: '192.168.1.0'
}
ipAddress: '2.2.2.2'
linkProperties: {
linkProviderName: 'contoso'
linkSpeedInMbps: 5
}
}
}
]
o365Policy: {
breakOutCategories: {
optimize: true
allow: true
default: true
}
}
roleAssignments: [
{
roleDefinitionIdOrName: 'Reader'
principalIds: [
resourceGroupResources.outputs.managedIdentityPrincipalId
]
}
]
}
}
20 changes: 0 additions & 20 deletions modules/Microsoft.Network/vpnSites/.test/min.parameters.json

This file was deleted.

13 changes: 13 additions & 0 deletions modules/Microsoft.Network/vpnSites/.test/min/dependencies.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@description('Required. The name of the virtual WAN to create.')
param virtualWANName string

@description('Optional. The location to deploy resources to.')
param location string = resourceGroup().location

resource virtualWan 'Microsoft.Network/virtualWans@2021-05-01' = {
name: virtualWANName
location: location
}

@description('The resource ID of the created Virtual WAN')
output virtualWWANResourceId string = virtualWan.id
50 changes: 50 additions & 0 deletions modules/Microsoft.Network/vpnSites/.test/min/deploy.test.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
targetScope = 'subscription'

// ========== //
// Parameters //
// ========== //
@description('Optional. The name of the resource group to deploy for testing purposes.')
@maxLength(80)
param resourceGroupName string = 'ms.network.vpnSites-${serviceShort}-rg'

@description('Optional. The location to deploy resources to.')
param location string = deployment().location

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'nvsmin'

// =========== //
// Deployments //
// =========== //

// General resources
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: location
}

module resourceGroupResources 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, location)}-paramNested'
params: {
virtualWANName: 'dep-<<namePrefix>>-vw-${serviceShort}'
}
}

// ============== //
// Test Execution //
// ============== //

module testDeployment '../../deploy.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name)}-test-${serviceShort}'
params: {
name: '<<namePrefix>>-${serviceShort}'
virtualWanId: resourceGroupResources.outputs.virtualWWANResourceId
addressPrefixes: [
'10.0.0.0/16'
]
ipAddress: '1.2.3.4'
}
}
77 changes: 0 additions & 77 deletions modules/Microsoft.Network/vpnSites/.test/parameters.json

This file was deleted.

4 changes: 2 additions & 2 deletions modules/Microsoft.Network/vpnSites/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ param location string = resourceGroup().location
@description('Optional. Tags of the resource.')
param tags object = {}

@description('Optional. An array of IP address ranges that can be used by subnets of the virtual network. Must be provided if no bgpProperties or VPNSiteLinks are configured.')
@description('Conditional. An array of IP address ranges that can be used by subnets of the virtual network. Required if no bgpProperties or VPNSiteLinks are configured.')
param addressPrefixes array = []

@description('Optional. BGP settings details. Must be provided if no addressPrefixes or VPNSiteLinks are configured. Note: This is a deprecated property, please use the corresponding VpnSiteLinks property instead.')
@description('Conditional. BGP settings details. Note: This is a deprecated property, please use the corresponding VpnSiteLinks property instead. Required if no addressPrefixes or VPNSiteLinks are configured.')
param bgpProperties object = {}

@description('Optional. List of properties of the device.')
Expand Down
Loading