-
Notifications
You must be signed in to change notification settings - Fork 437
VPN Gateway: Added module #1068
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
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
9c5ded6
Update to latest
AlexanderSehr 1fc5816
Update to latest
AlexanderSehr 5722da0
Update to latest
AlexanderSehr 7659551
Update to latest
AlexanderSehr 3bf5288
Update to latest
AlexanderSehr 9bcb2c4
Update to latest
AlexanderSehr cbdf97f
Update to latest
AlexanderSehr a3afeb9
Update to latest
AlexanderSehr 85ad499
Update to latest
AlexanderSehr 677029c
Update to latest
AlexanderSehr 2b733a0
Update to latest
AlexanderSehr f7d9501
Update to latest
AlexanderSehr 319bcd4
Update to latest
AlexanderSehr bdc1b85
Added missing version file
AlexanderSehr 5c96266
Update to latest
AlexanderSehr 2ad0df2
Update to latest
AlexanderSehr 38a7e3c
Update to latest
AlexanderSehr b015c31
Update to latest
AlexanderSehr 17bc29c
Update to latest
AlexanderSehr 836c3a5
Update to latest
AlexanderSehr 6a20102
Update to latest
AlexanderSehr a225be2
Update to latest
AlexanderSehr 88ca8df
Update to latest
AlexanderSehr 765b582
Update to latest
AlexanderSehr be06cb9
Update to latest
AlexanderSehr 757d9f1
Disabled jbos
AlexanderSehr 6e6c389
Update to latest
AlexanderSehr f3a7f53
Update to latest
AlexanderSehr a5a85f6
Added NAT rules
AlexanderSehr 32370cf
Update to latest
AlexanderSehr 1d0ef9b
Update to latest
AlexanderSehr f894559
Update to latest
AlexanderSehr 712f425
Added vpn link config
AlexanderSehr 6384bb7
Update to latest
AlexanderSehr 4a007b3
Updated Link
AlexanderSehr f58c41d
Update to latest
AlexanderSehr cb0572d
Update to latest
AlexanderSehr 59a95a1
Update to latest
AlexanderSehr 38f266f
Update to latest
AlexanderSehr 67ca199
Update to latest
AlexanderSehr 655d9a3
Update to latest
AlexanderSehr 3a50094
Merge branch 'main' into users/alsehr/1025_vpnGw
AlexanderSehr 24b54a9
Update arm/Microsoft.Network/vpnGateways/.parameters/parameters.json
AlexanderSehr 2baaa7f
Update arm/Microsoft.Network/vpnGateways/.parameters/parameters.json
AlexanderSehr 5e4eebf
Update arm/Microsoft.Network/vpnGateways/.parameters/min.parameters.json
AlexanderSehr 664edc7
Update arm/Microsoft.Network/vpnGateways/deploy.bicep
AlexanderSehr af075d3
Update arm/Microsoft.Network/vpnGateways/deploy.bicep
AlexanderSehr 994bbb6
Update arm/Microsoft.Network/vpnGateways/connections/deploy.bicep
AlexanderSehr 90419b8
Update arm/Microsoft.Network/vpnGateways/connections/deploy.bicep
AlexanderSehr 9027184
Update arm/Microsoft.Network/vpnGateways/connections/deploy.bicep
AlexanderSehr 10def83
Update arm/Microsoft.Network/vpnGateways/connections/deploy.bicep
AlexanderSehr 9ba3c32
Update arm/Microsoft.Network/vpnGateways/natRules/deploy.bicep
AlexanderSehr 52c68b6
Update to latest
AlexanderSehr 910f8b8
Merge branch 'users/alsehr/1025_vpnGw' of https://github.com/Azure/Re…
AlexanderSehr f83d774
rename
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: 'Network - VPN Gateway' | ||
|
|
||
| parameters: | ||
| - name: removeDeployment | ||
| displayName: Remove deployed module | ||
| type: boolean | ||
| default: true | ||
| - name: prerelease | ||
| displayName: Publish prerelease module | ||
| type: boolean | ||
| default: false | ||
|
|
||
| trigger: | ||
| batch: true | ||
| branches: | ||
| include: | ||
| - main | ||
| paths: | ||
| include: | ||
| - '/.azuredevops/modulePipelines/ms.network.vpnGateways.yml' | ||
| - '/.azuredevops/pipelineTemplates/module.*.yml' | ||
| - '/arm/Microsoft.Network/vpnGateways/*' | ||
| exclude: | ||
| - '/**/*.md' | ||
|
|
||
| variables: | ||
| - template: '/.azuredevops/pipelineVariables/global.variables.yml' | ||
| - group: 'PLATFORM_VARIABLES' | ||
| - name: modulePath | ||
| value: '/arm/Microsoft.Network/vpnGateways' | ||
|
|
||
| stages: | ||
| - stage: Validation | ||
| displayName: Pester tests | ||
| jobs: | ||
| - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml | ||
|
|
||
| - stage: Deployment | ||
| displayName: Deployment tests | ||
| jobs: | ||
| - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml | ||
| parameters: | ||
| removeDeployment: '${{ parameters.removeDeployment }}' | ||
| deploymentBlocks: | ||
| - path: $(modulePath)/.parameters/min.parameters.json | ||
| - path: $(modulePath)/.parameters/parameters.json | ||
|
|
||
| - stage: Publishing | ||
| displayName: Publish module | ||
| condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq('${{ parameters.prerelease }}', 'true'))) | ||
| jobs: | ||
| - template: /.azuredevops/pipelineTemplates/jobs.publishModule.yml |
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,135 @@ | ||
| name: 'Network - VPN Gateway' | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| removeDeployment: | ||
| type: boolean | ||
| description: 'Remove deployed module' | ||
| required: false | ||
| default: 'true' | ||
| prerelease: | ||
| type: boolean | ||
| description: 'Publish prerelease module' | ||
| required: false | ||
| default: 'false' | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/actions/templates/**' | ||
| - '.github/workflows/ms.network.vpnGateways.yml' | ||
| - 'arm/Microsoft.Network/vpnGateways/**' | ||
| - '!*/**/readme.md' | ||
| - 'utilities/pipelines/**' | ||
| - '!utilities/pipelines/dependencies/**' | ||
|
|
||
| env: | ||
| modulePath: 'arm/Microsoft.Network/vpnGateways' | ||
| workflowPath: '.github/workflows/ms.network.vpnGateways.yml' | ||
| AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
| ARM_SUBSCRIPTION_ID: '${{ secrets.ARM_SUBSCRIPTION_ID }}' | ||
| ARM_MGMTGROUP_ID: '${{ secrets.ARM_MGMTGROUP_ID }}' | ||
| ARM_TENANT_ID: '${{ secrets.ARM_TENANT_ID }}' | ||
| DEPLOYMENT_SP_ID: '${{ secrets.DEPLOYMENT_SP_ID }}' | ||
|
|
||
| jobs: | ||
| ############################ | ||
| # SET INPUT PARAMETERS # | ||
| ############################ | ||
| job_set_workflow_param: | ||
| runs-on: ubuntu-20.04 | ||
| name: 'Set input parameters to output variables' | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: 'Set input parameters' | ||
| id: get-workflow-param | ||
| uses: ./.github/actions/templates/getWorkflowInput | ||
| with: | ||
| workflowPath: '${{ env.workflowPath}}' | ||
| outputs: | ||
| removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} | ||
|
|
||
| #################### | ||
| # Pester Tests # | ||
| #################### | ||
| job_module_pester_validation: | ||
| runs-on: ubuntu-20.04 | ||
| name: 'Pester tests' | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: 'Run tests' | ||
| uses: ./.github/actions/templates/validateModulePester | ||
| with: | ||
| modulePath: '${{ env.modulePath }}' | ||
|
|
||
| #################### | ||
| # Deployment tests # | ||
| #################### | ||
| job_module_deploy_validation: | ||
| runs-on: ubuntu-20.04 | ||
| name: 'Deployment tests' | ||
| needs: | ||
| - job_set_workflow_param | ||
| - job_module_pester_validation | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| parameterFilePaths: ['min.parameters.json', 'parameters.json'] | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set environment variables | ||
| uses: deep-mm/set-variables@v1.0 | ||
| with: | ||
| variableFileName: 'global.variables' | ||
| - name: 'Using parameter file [${{ matrix.parameterFilePaths }}]' | ||
| uses: ./.github/actions/templates/validateModuleDeployment | ||
| with: | ||
| templateFilePath: '${{ env.modulePath }}/deploy.bicep' | ||
| parameterFilePath: '${{ env.modulePath }}/.parameters/${{ matrix.parameterFilePaths }}' | ||
| location: '${{ env.defaultLocation }}' | ||
| resourceGroupName: '${{ env.resourceGroupName }}' | ||
| subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' | ||
| managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' | ||
| removeDeployment: '${{ needs.job_set_workflow_param.outputs.removeDeployment }}' | ||
|
|
||
| ############### | ||
| # PUBLISH # | ||
| ############### | ||
| job_publish_module: | ||
| name: 'Publish module' | ||
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' | ||
| runs-on: ubuntu-20.04 | ||
| needs: | ||
| - job_set_workflow_param | ||
| - job_module_deploy_validation | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set environment variables | ||
| uses: deep-mm/set-variables@v1.0 | ||
| with: | ||
| variableFileName: 'global.variables' | ||
| - name: 'Publish module' | ||
| uses: ./.github/actions/templates/publishModule | ||
| with: | ||
| templateFilePath: '${{ env.modulePath }}/deploy.bicep' | ||
| templateSpecsRGName: '${{ env.templateSpecsRGName }}' | ||
| templateSpecsRGLocation: '${{ env.templateSpecsRGLocation }}' | ||
| templateSpecsDescription: '${{ env.templateSpecsDescription }}' | ||
| templateSpecsDoPublish: '${{ env.templateSpecsDoPublish }}' | ||
| bicepRegistryName: '${{ env.bicepRegistryName }}' | ||
| bicepRegistryRGName: '${{ env.bicepRegistryRGName }}' | ||
| bicepRegistryRgLocation: '${{ env.bicepRegistryRgLocation }}' | ||
| bicepRegistryDoPublish: '${{ env.bicepRegistryDoPublish }}' |
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 @@ | ||
|
|
12 changes: 12 additions & 0 deletions
12
arm/Microsoft.Network/vpnGateways/.parameters/min.parameters.json
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,12 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-az-vpngw-min-001" | ||
| }, | ||
| "virtualHubResourceId": { | ||
| "value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<<namePrefix>>-az-vhub-min-001" | ||
| } | ||
| } | ||
| } |
65 changes: 65 additions & 0 deletions
65
arm/Microsoft.Network/vpnGateways/.parameters/parameters.json
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,65 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "name": { | ||
| "value": "<<namePrefix>>-az-vpngw-x-001" | ||
| }, | ||
| "virtualHubResourceId": { | ||
| "value": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<<namePrefix>>-az-vhub-x-001" | ||
| }, | ||
| "bgpSettings": { | ||
| "value": { | ||
| "asn": 65515, | ||
| "peerWeight": 0 | ||
| } | ||
| }, | ||
| "connections": { | ||
| "value": [ | ||
| { | ||
| "name": "Connection-<<namePrefix>>-az-vsite-x-001", | ||
| "connectionBandwidth": 10, | ||
| "enableBgp": true, | ||
| "routingConfiguration": { | ||
| "associatedRouteTable": { | ||
| "id": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<<namePrefix>>-az-vhub-x-001/hubRouteTables/defaultRouteTable" | ||
| }, | ||
| "propagatedRouteTables": { | ||
| "labels": [ | ||
| "default" | ||
| ], | ||
| "ids": [ | ||
| { | ||
| "id": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualHubs/<<namePrefix>>-az-vhub-x-001/hubRouteTables/defaultRouteTable" | ||
| } | ||
| ] | ||
| }, | ||
| "vnetRoutes": { | ||
| "staticRoutes": [] | ||
| } | ||
| }, | ||
| "remoteVpnSiteResourceId": "/subscriptions/<<subscriptionId>>/resourceGroups/validation-rg/providers/Microsoft.Network/vpnSites/<<namePrefix>>-az-vsite-x-001" | ||
| } | ||
| ] | ||
| }, | ||
| "natRules": { | ||
| "value": [ | ||
| { | ||
| "name": "natRule1", | ||
| "internalMappings": [ | ||
| { | ||
| "addressSpace": "10.4.0.0/24" | ||
| } | ||
| ], | ||
| "externalMappings": [ | ||
| { | ||
| "addressSpace": "192.168.21.0/24" | ||
| } | ||
| ], | ||
| "type": "Static", | ||
| "mode": "EgressSnat" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
1 change: 1 addition & 0 deletions
1
arm/Microsoft.Network/vpnGateways/connections/.bicep/nested_cuaId.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 @@ | ||
|
|
95 changes: 95 additions & 0 deletions
95
arm/Microsoft.Network/vpnGateways/connections/deploy.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,95 @@ | ||
| @description('Required. The name of the VPN connection.') | ||
| param name string | ||
|
|
||
| @description('Required. The name of the VPN gateway this VPN connection is associated with.') | ||
| param vpnGatewayName string | ||
|
|
||
| @description('Optional. The IPSec policies to be considered by this connection.') | ||
| param ipsecPolicies array = [] | ||
|
|
||
| @description('Optional. The traffic selector policies to be considered by this connection.') | ||
| param trafficSelectorPolicies array = [] | ||
|
|
||
| @description('Optional. List of all VPN site link connections to the gateway.') | ||
| param vpnLinkConnections array = [] | ||
|
|
||
| @description('Optional. Routing configuration indicating the associated and propagated route tables for this connection.') | ||
| param routingConfiguration object = {} | ||
|
|
||
| @description('Optional. Enable policy-based traffic selectors.') | ||
| param usePolicyBasedTrafficSelectors bool = false | ||
|
|
||
| @description('Optional. Use local Azure IP to initiate connection.') | ||
| param useLocalAzureIpAddress bool = false | ||
|
|
||
| @description('Optional. Enable rate limiting.') | ||
| param enableRateLimiting bool = false | ||
|
|
||
| @description('Optional. Enable internet security.') | ||
| param enableInternetSecurity bool = false | ||
|
|
||
| @description('Optional. Enable BGP flag.') | ||
| param enableBgp bool = false | ||
|
|
||
| @description('Optional. Routing weight for VPN connection.') | ||
| param routingWeight int = 0 | ||
|
|
||
| @description('Optional. Expected bandwidth in MBPS.') | ||
| param connectionBandwidth int = 10 | ||
|
|
||
| @description('Optional. Gateway connection protocol.') | ||
| @allowed([ | ||
| 'IKEv1' | ||
| 'IKEv2' | ||
| ]) | ||
| param vpnConnectionProtocolType string = 'IKEv2' | ||
|
|
||
| @description('Optional. SharedKey for the VPN connection.') | ||
| param sharedKey string = '' | ||
|
|
||
| @description('Optional. Reference to a VPN site to link to') | ||
| param remoteVpnSiteResourceId string = '' | ||
|
|
||
| @description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered') | ||
| param cuaId string = '' | ||
|
|
||
| module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) { | ||
| name: 'pid-${cuaId}' | ||
| params: {} | ||
| } | ||
|
|
||
| resource vpnGateway 'Microsoft.Network/vpnGateways@2021-05-01' existing = { | ||
| name: vpnGatewayName | ||
| } | ||
|
|
||
| resource vpnConnection 'Microsoft.Network/vpnGateways/vpnConnections@2021-05-01' = { | ||
| name: name | ||
| parent: vpnGateway | ||
| properties: { | ||
| connectionBandwidth: connectionBandwidth | ||
| enableBgp: enableBgp | ||
| enableInternetSecurity: enableInternetSecurity | ||
| enableRateLimiting: enableRateLimiting | ||
| ipsecPolicies: ipsecPolicies | ||
| remoteVpnSite: !empty(remoteVpnSiteResourceId) ? { | ||
| id: remoteVpnSiteResourceId | ||
| } : null | ||
| routingConfiguration: routingConfiguration | ||
| routingWeight: routingWeight | ||
| sharedKey: sharedKey | ||
| trafficSelectorPolicies: trafficSelectorPolicies | ||
| useLocalAzureIpAddress: useLocalAzureIpAddress | ||
| usePolicyBasedTrafficSelectors: usePolicyBasedTrafficSelectors | ||
| vpnConnectionProtocolType: vpnConnectionProtocolType | ||
| vpnLinkConnections: vpnLinkConnections | ||
| } | ||
| } | ||
|
|
||
| @description('The name of the VPN connection') | ||
| output name string = vpnConnection.name | ||
|
|
||
| @description('The resource ID of the VPN connection') | ||
| output resourceId string = vpnConnection.id | ||
|
|
||
| @description('The name of the resource group the VPN connection was deployed into') | ||
| output resourceGroupName string = resourceGroup().name |
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.