-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Updated Network/VirtualNetworkGateways to new dependency approach #1832
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
Merged
AlexanderSehr
merged 17 commits into
main
from
users/alsehr/1791_Network_VirtualNetworkGateways
Nov 7, 2022
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6abbc91
[Modules] Updated Network/VirtualNetworkGateways to new dependency ap…
AlexanderSehr 7dc89bf
Merge branch 'main' into users/alsehr/1791_Network_VirtualNetworkGate…
AlexanderSehr cfbb9f1
Update to latest
AlexanderSehr 1524692
Merge branch 'main' into users/alsehr/1791_Network_VirtualNetworkGate…
AlexanderSehr 829a3fe
Update to latest
AlexanderSehr cbd5105
Update to latest
AlexanderSehr 95c47bc
Update to latest
AlexanderSehr 39091ad
Update to latest
AlexanderSehr 139eecf
Update modules/Microsoft.Network/virtualNetworkGateways/.test/express…
AlexanderSehr 38bcc9b
Update modules/Microsoft.Network/virtualNetworkGateways/.test/vpn/dep…
AlexanderSehr 1ac8c95
Update to latest
AlexanderSehr 260ba70
Merge branch 'main' into users/alsehr/1791_Network_VirtualNetworkGate…
AlexanderSehr 11177c2
Updated gw to latst
AlexanderSehr c9356e0
Update modules/Microsoft.Network/virtualNetworkGateways/.test/vpn/dep…
AlexanderSehr 8a54607
Update modules/Microsoft.Network/virtualNetworkGateways/.test/aadvpn/…
AlexanderSehr c69485a
Update modules/Microsoft.Network/virtualNetworkGateways/.test/aadvpn/…
AlexanderSehr f9f0939
Updated readme
AlexanderSehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
modules/Microsoft.Network/virtualNetworkGateways/.test/aadvpn.parameters.json
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
modules/Microsoft.Network/virtualNetworkGateways/.test/aadvpn/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| @description('Required. The name of the Virtual Network to create.') | ||
| param virtualNetworkName string | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { | ||
| name: virtualNetworkName | ||
| location: location | ||
| properties: { | ||
| addressSpace: { | ||
| addressPrefixes: [ | ||
| '10.0.0.0/24' | ||
| ] | ||
| } | ||
| subnets: [ | ||
| { | ||
| name: 'GatewaySubnet' | ||
| properties: { | ||
| addressPrefix: '10.0.0.0/24' | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The resource ID of the created Virtual Network.') | ||
| output vnetResourceId string = virtualNetwork.id | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
97 changes: 97 additions & 0 deletions
97
modules/Microsoft.Network/virtualNetworkGateways/.test/aadvpn/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(80) | ||
| param resourceGroupName string = 'ms.network.virtualnetworkgateways-${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 = 'nvngavpn' | ||
|
|
||
| // =========== // | ||
| // 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: { | ||
| virtualNetworkName: 'dep-<<namePrefix>>-vnet-${serviceShort}' | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // Diagnostics | ||
| // =========== | ||
| module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' | ||
| params: { | ||
| storageAccountName: 'dep<<namePrefix>>diasa${serviceShort}01' | ||
| logAnalyticsWorkspaceName: 'dep-<<namePrefix>>-law-${serviceShort}' | ||
| eventHubNamespaceEventHubName: 'dep-<<namePrefix>>-evh-${serviceShort}' | ||
| eventHubNamespaceName: 'dep-<<namePrefix>>-evhns-${serviceShort}' | ||
| location: location | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| name: '<<namePrefix>>${serviceShort}001' | ||
| virtualNetworkGatewaySku: 'VpnGw2AZ' | ||
| virtualNetworkGatewayType: 'Vpn' | ||
| vNetResourceId: resourceGroupResources.outputs.vnetResourceId | ||
| activeActive: false | ||
| diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId | ||
| diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId | ||
| diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId | ||
| diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName | ||
| domainNameLabel: [ | ||
| '<<namePrefix>>-dm-${serviceShort}' | ||
| ] | ||
| lock: 'CanNotDelete' | ||
| publicIpZones: [ | ||
| '1' | ||
| ] | ||
| roleAssignments: [ | ||
| { | ||
| roleDefinitionIdOrName: 'Reader' | ||
| principalIds: [ | ||
| resourceGroupResources.outputs.managedIdentityPrincipalId | ||
| ] | ||
| principalType: 'ServicePrincipal' | ||
| } | ||
| ] | ||
| vpnClientAadConfiguration: { | ||
| // The Application ID of the "Azure VPN" Azure AD Enterprise App for Azure Public | ||
| aadAudience: '41b23e61-6c1e-4545-b367-cd054e0ed4b4' | ||
AlexanderSehr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| aadIssuer: 'https://sts.windows.net/${tenant().tenantId}/' | ||
| aadTenant: '${environment().authentication.loginEndpoint}/${tenant().tenantId}/' | ||
| vpnAuthenticationTypes: [ | ||
| 'AAD' | ||
| ] | ||
| vpnClientProtocols: [ | ||
| 'OpenVPN' | ||
| ] | ||
| } | ||
| vpnType: 'RouteBased' | ||
| } | ||
| } | ||
61 changes: 0 additions & 61 deletions
61
modules/Microsoft.Network/virtualNetworkGateways/.test/expressRoute.parameters.json
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
modules/Microsoft.Network/virtualNetworkGateways/.test/expressRoute/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| @description('Required. The name of the Virtual Network to create.') | ||
| param virtualNetworkName string | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { | ||
| name: virtualNetworkName | ||
| location: location | ||
| properties: { | ||
| addressSpace: { | ||
| addressPrefixes: [ | ||
| '10.0.0.0/24' | ||
| ] | ||
| } | ||
| subnets: [ | ||
| { | ||
| name: 'GatewaySubnet' | ||
| properties: { | ||
| addressPrefix: '10.0.0.0/24' | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The resource ID of the created Virtual Network.') | ||
| output vnetResourceId string = virtualNetwork.id | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.