-
Notifications
You must be signed in to change notification settings - Fork 437
Users/ahmad/vnet peering #199
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 59 commits into
Azure:main
from
ahmadabdalla:users/ahmad/vnetPeering
Oct 17, 2021
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
8e9b44a
added Az Policy and RBAC Modules
ahmadabdalla 2cc5129
updated user identity module
ahmadabdalla dc2f0e0
Merge remote-tracking branch 'upstream/main' into users/ahmadabdalla/…
ahmadabdalla d18259e
catered for scenario where retryLimit is set to 1
ahmadabdalla 885675a
added (ge) instead of (gt) for catch
ahmadabdalla 513e45a
updated based on comments
ahmadabdalla 64f5d4f
Merge remote-tracking branch 'upstream/main' into users/ahmadabdalla/…
ahmadabdalla f7af60b
updated lock scope
ahmadabdalla 80b8ef4
updated test error for readme
ahmadabdalla eefcc6d
Merge remote-tracking branch 'upstream/main' into users/ahmadabdalla/…
ahmadabdalla 155cd44
updated readme
ahmadabdalla 45c5d93
fixed readme
ahmadabdalla a5fb7da
updated readme with check mark
ahmadabdalla 3cc62ba
updated lock resource
ahmadabdalla f338e0d
Merge remote-tracking branch 'upstream/main' into users/ahmadabdalla/…
ahmadabdalla da792b7
Merge branch 'main' into users/ahmadabdalla/policyAndRbac
ahmadabdalla ef2e595
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 6b3d55c
Merge branch 'main' into users/ahmadabdalla/policyAndRbac
ahmadabdalla c8e9092
Clean up commit
ahmadabdalla 9b99228
Modified pipelines to point to bicep file instead
ahmadabdalla b4c8a08
updated read me
ahmadabdalla 9b4f45d
supressed parameter location validation
ahmadabdalla 81b129e
added workaround
ahmadabdalla 24fb130
added readme details
ahmadabdalla da0faf2
completed RBAC Assignment
ahmadabdalla ccb3648
remove check for variable name (_)
ahmadabdalla d19f3e3
updated policy read me
ahmadabdalla 52d6393
updated policy
ahmadabdalla a371fd9
updated parameters
ahmadabdalla 2dbafbe
updated readme
ahmadabdalla 4d175a8
updated policy length
ahmadabdalla dda7d66
updated policy definitions pipeline
ahmadabdalla 80f64b1
added exemption and set definition pipelines
ahmadabdalla b6b4496
Merge pull request #1 from ahmadabdalla/users/ahmadabdalla/policyAndRbac
ahmadabdalla 59c807e
Users/ahmadabdalla/ms authorization (#2)
ahmadabdalla b307412
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 86d6c2d
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 9ba64cb
Users/ahmadabdalla/ms auth comments (#3)
ahmadabdalla 51ad772
Merge branch 'Azure:main' into main
ahmadabdalla c69e208
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 8f44d6d
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 442f25b
Merge remote-tracking branch 'upstream/main'
ahmadabdalla cfd6226
Merge remote-tracking branch 'upstream/main'
ahmadabdalla e669249
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 10659c3
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 53242e6
added current version of roles to constructs
ahmadabdalla f84ad1e
Merge remote-tracking branch 'upstream/main'
ahmadabdalla 60153e5
updated parameter files to point to test subscription
ahmadabdalla 353842e
updated based on feedback
ahmadabdalla 3442cf5
Merge remote-tracking branch 'upstream/main'
ahmadabdalla e3c62c7
updated to test principal ID
ahmadabdalla 5239741
Merge branch 'Azure:main' into main
ahmadabdalla 54905b5
Merge branch 'Azure:main' into main
ahmadabdalla 03373f5
Merge remote-tracking branch 'upstream/main'
ahmadabdalla e4266d8
Merge branch 'main' of https://github.com/ahmadabdalla/Modules
ahmadabdalla 2613a92
Updated VNET Peering Template
ahmadabdalla 1563519
updated output from testing
ahmadabdalla 2d0ffb7
Updated virtual network peering bicep module
ahmadabdalla d044253
restored parameters to iacs
ahmadabdalla 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
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
Empty file.
30 changes: 30 additions & 0 deletions
30
...cts/Microsoft.Network/virtualNetwork/virtualNetworkPeerings-multiRemoteVnets/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,30 @@ | ||
| @description('Required. The Name of the Virtual Network to add the peering to.') | ||
| param localVnetName string | ||
|
|
||
| @description('Optional. Optional. The list of remote networks to peering peer with, including the configuration.') | ||
| param peeringConfigurations array = [] | ||
|
|
||
| @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 virtualNetworkPeering 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2020-05-01' = [for peeringConfiguration in peeringConfigurations: { | ||
| name: contains(peeringConfiguration, 'peeringName') ? '${localVnetName}/${peeringConfiguration.peeringName}' : '${localVnetName}/${localVnetName}-${last(split(peeringConfiguration.remoteVirtualNetworkId, '/'))}' | ||
| properties: { | ||
| allowVirtualNetworkAccess: contains(peeringConfiguration, 'allowVirtualNetworkAccess') ? peeringConfiguration.allowVirtualNetworkAccess : true | ||
| allowForwardedTraffic: contains(peeringConfiguration, 'allowForwardedTraffic') ? peeringConfiguration.allowForwardedTraffic : true | ||
| allowGatewayTransit: contains(peeringConfiguration, 'allowGatewayTransit') ? peeringConfiguration.allowGatewayTransit : false | ||
| useRemoteGateways: contains(peeringConfiguration, 'useRemoteGateways') ? peeringConfiguration.useRemoteGateways : true | ||
| remoteVirtualNetwork: { | ||
| id: peeringConfiguration.remoteVirtualNetworkId | ||
| } | ||
| } | ||
| }] | ||
|
|
||
| output virtualNetworkPeeringResourceGroup string = resourceGroup().name | ||
| output virtualNetworkPeeringNames array = [for i in range(0, length(peeringConfigurations)): virtualNetworkPeering[i].name] | ||
| output localVirtualNetworkPeeringResourceIds array = [for peeringConfiguration in peeringConfigurations: resourceId('Microsoft.Network/virtualNetworks/virtualNetworkPeerings', localVnetName, (contains(peeringConfiguration, 'peeringName') ? peeringConfiguration.peeringName : '${localVnetName}-${last(split(peeringConfiguration.remoteVirtualNetworkId, '/'))}')) ] | ||
22 changes: 22 additions & 0 deletions
22
...Network/virtualNetwork/virtualNetworkPeerings-multiRemoteVnets/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,22 @@ | ||
| { | ||
| "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
| "contentVersion": "1.0.0.0", | ||
| "parameters": { | ||
| "localVnetName": { | ||
| "value": "sxx-az-vnet-weu-x-004" | ||
| }, | ||
| "peeringConfigurations": { | ||
| "value": [ | ||
| { | ||
| "peeringName": "sxx-az-peering-weu-x-002-sxx-az-peering-weu-x-003", | ||
| "remoteVirtualNetworkId": "/subscriptions/8629be3b-96bc-482d-a04b-ffff597c65a2/resourceGroups/dependencies-rg/providers/Microsoft.Network/virtualNetworks/sxx-az-vnet-weu-x-003", | ||
| "useRemoteGateways": false | ||
| }, | ||
| { | ||
| "remoteVirtualNetworkId": "/subscriptions/8629be3b-96bc-482d-a04b-ffff597c65a2/resourceGroups/dependencies-rg/providers/Microsoft.Network/virtualNetworks/peeringNetwork", | ||
| "useRemoteGateways": false | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
...rosoft.Network/virtualNetwork/virtualNetworkPeerings-multiRemoteVnets/readme.md
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,62 @@ | ||
| # VirtualNetworkPeering | ||
|
|
||
| This template deploys Virtual Network Peering. | ||
|
|
||
| ## Resource types | ||
|
|
||
| | Resource Type | Api Version | | ||
| | :-- | :-- | | ||
| | `Microsoft.Network/virtualNetworks/virtualNetworkPeerings` | 2020-05-01 | | ||
| | `Microsoft.Resources/deployments` | 2019-10-01 | | ||
|
|
||
| ### Resource dependency | ||
|
|
||
| The following resources are required to be able to deploy this resource. | ||
|
|
||
| - *None* | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter Name | Type | Description | DefaultValue | Possible values | | ||
| | :-- | :-- | :-- | :-- | :-- | | ||
| | `cuaId` | string | Optional. Customer Usage Attribution id (GUID). This GUID must be previously registered | | | | ||
| | `localVnetName` | string | Required. The Name of the Virtual Network to add the peering to. | | | | ||
| | `peeringConfigurations` | array | Optional. The list of remote networks to peering peer with, including the configuration. See below for instructions. | System.Object[] | | | ||
|
|
||
| ### Parameter Usage: `peeringConfigurations` | ||
|
|
||
| Array containing multiple objects for different VNETs to peer with. | ||
|
|
||
| ```json | ||
| "peeringConfigurations": { | ||
| "value": [ | ||
| { | ||
| "peeringName": "sxx-az-peering-weu-x-002-sxx-az-peering-weu-x-003", // Optional | ||
| "remoteVirtualNetworkId": "/subscriptions/<subscriptionId>/resourceGroups/dependencies-rg/providers/Microsoft.Network/virtualNetworks/<vnetName>", | ||
| "allowVirtualNetworkAccess": false, // Optional. Default true | ||
| "allowForwardedTraffic": false, // Optional. Default true | ||
| "allowGatewayTransit": false, // Optional. Default false | ||
| "useRemoteGateways": false // Optional. Default true | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Output Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `localVirtualNetworkPeeringResourceIds` | array | | | ||
| | `virtualNetworkPeeringNames` | array | | | ||
| | `virtualNetworkPeeringResourceGroup` | string | | | ||
|
|
||
| ## Considerations | ||
|
|
||
| - *None* | ||
|
|
||
| ## Additional resources | ||
|
|
||
| - [Use tags to organize your Azure resources](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags) | ||
| - [Azure Resource Manager template reference](https://docs.microsoft.com/en-us/azure/templates/) | ||
| - [VirtualNetworks/VirtualNetworkPeerings](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Network/2020-05-01/virtualNetworks/virtualNetworkPeerings) | ||
| - [Deployments](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Resources/2019-10-01/deployments) |
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.