Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions avm/res/network/virtual-network/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/network/virtual-network/CHANGELOG.md).

## 0.7.3

### Changes

- Enabling child module `avm/res/network/virtual-network/virtual-network-peering` for publishing

### Breaking Changes

- None

## 0.7.2

### Changes
Expand Down
2 changes: 2 additions & 0 deletions avm/res/network/virtual-network/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ module virtualNetwork_peering_local 'virtual-network-peering/main.bicep' = [
allowVirtualNetworkAccess: peering.?allowVirtualNetworkAccess
doNotVerifyRemoteGateways: peering.?doNotVerifyRemoteGateways
useRemoteGateways: peering.?useRemoteGateways
enableTelemetry: enableReferencedModulesTelemetry
}
}
]
Expand All @@ -234,6 +235,7 @@ module virtualNetwork_peering_remote 'virtual-network-peering/main.bicep' = [
allowVirtualNetworkAccess: peering.?remotePeeringAllowVirtualNetworkAccess
doNotVerifyRemoteGateways: peering.?remotePeeringDoNotVerifyRemoteGateways
useRemoteGateways: peering.?remotePeeringUseRemoteGateways
enableTelemetry: enableReferencedModulesTelemetry
}
}
]
Expand Down
66 changes: 63 additions & 3 deletions avm/res/network/virtual-network/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.41.2.15936",
"templateHash": "1472786377929745029"
"templateHash": "10631548886110951670"
},
"name": "Virtual Networks",
"description": "This module deploys a Virtual Network (vNet)."
Expand Down Expand Up @@ -1303,6 +1303,9 @@
},
"useRemoteGateways": {
"value": "[tryGet(coalesce(parameters('peerings'), createArray())[copyIndex()], 'useRemoteGateways')]"
},
"enableTelemetry": {
"value": "[variables('enableReferencedModulesTelemetry')]"
}
},
"template": {
Expand All @@ -1312,7 +1315,7 @@
"_generator": {
"name": "bicep",
"version": "0.41.2.15936",
"templateHash": "6939030350004475953"
"templateHash": "12733308459175495117"
},
"name": "Virtual Network Peerings",
"description": "This module deploys a Virtual Network Peering."
Expand All @@ -1331,6 +1334,13 @@
"description": "Conditional. The name of the parent Virtual Network to add the peering to. Required if the template is used in a standalone deployment."
}
},
"enableTelemetry": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Enable/Disable usage telemetry for module."
}
},
"remoteVirtualNetworkResourceId": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -1374,6 +1384,26 @@
}
},
"resources": [
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.res.network-virtualnetwork-peering.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [],
"outputs": {
"telemetry": {
"type": "String",
"value": "For more information, see https://aka.ms/avm/TelemetryInfo"
}
}
}
}
},
{
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"apiVersion": "2024-01-01",
Expand Down Expand Up @@ -1460,6 +1490,9 @@
},
"useRemoteGateways": {
"value": "[tryGet(coalesce(parameters('peerings'), createArray())[copyIndex()], 'remotePeeringUseRemoteGateways')]"
},
"enableTelemetry": {
"value": "[variables('enableReferencedModulesTelemetry')]"
}
},
"template": {
Expand All @@ -1469,7 +1502,7 @@
"_generator": {
"name": "bicep",
"version": "0.41.2.15936",
"templateHash": "6939030350004475953"
"templateHash": "12733308459175495117"
},
"name": "Virtual Network Peerings",
"description": "This module deploys a Virtual Network Peering."
Expand All @@ -1488,6 +1521,13 @@
"description": "Conditional. The name of the parent Virtual Network to add the peering to. Required if the template is used in a standalone deployment."
}
},
"enableTelemetry": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Enable/Disable usage telemetry for module."
}
},
"remoteVirtualNetworkResourceId": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -1531,6 +1571,26 @@
}
},
"resources": [
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.res.network-virtualnetwork-peering.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [],
"outputs": {
"telemetry": {
"type": "String",
"value": "For more information, see https://aka.ms/avm/TelemetryInfo"
}
}
}
}
},
{
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"apiVersion": "2024-01-01",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/network/virtual-network/virtual-network-peering/CHANGELOG.md).

## 0.1.0

### Changes

- Initial version

### Breaking Changes

- None
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

This module deploys a Virtual Network Peering.

You can reference the module as follows:
```bicep
module virtualNetwork 'br/public:avm/res/network/virtual-network/virtual-network-peering:<version>' = {
params: { (...) }
}
```
For examples, please refer to the [Usage Examples](#usage-examples) section.

## Navigation

- [Resource Types](#Resource-Types)
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Data Collection](#Data-Collection)

## Resource Types

Expand Down Expand Up @@ -36,6 +45,7 @@ This module deploys a Virtual Network Peering.
| [`allowGatewayTransit`](#parameter-allowgatewaytransit) | bool | If gateway links can be used in remote virtual networking to link to this virtual network. Default is false. |
| [`allowVirtualNetworkAccess`](#parameter-allowvirtualnetworkaccess) | bool | Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. Default is true. |
| [`doNotVerifyRemoteGateways`](#parameter-donotverifyremotegateways) | bool | If we need to verify the provisioning state of the remote gateway. Default is true. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`name`](#parameter-name) | string | The Name of VNET Peering resource. If not provided, default value will be localVnetName-remoteVnetName. |
| [`useRemoteGateways`](#parameter-useremotegateways) | bool | If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Default is false. |

Expand Down Expand Up @@ -85,6 +95,14 @@ If we need to verify the provisioning state of the remote gateway. Default is tr
- Type: bool
- Default: `True`

### Parameter: `enableTelemetry`

Enable/Disable usage telemetry for module.

- Required: No
- Type: bool
- Default: `True`

### Parameter: `name`

The Name of VNET Peering resource. If not provided, default value will be localVnetName-remoteVnetName.
Expand All @@ -108,3 +126,7 @@ If remote gateways can be used on this virtual network. If the flag is set to tr
| `name` | string | The name of the virtual network peering. |
| `resourceGroupName` | string | The resource group the virtual network peering was deployed into. |
| `resourceId` | string | The resource ID of the virtual network peering. |

## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param name string = 'peer-${localVnetName}-${last(split(remoteVirtualNetworkReso
@description('Conditional. The name of the parent Virtual Network to add the peering to. Required if the template is used in a standalone deployment.')
param localVnetName string

@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

@description('Required. The Resource ID of the VNet that is this Local VNet is being peered to. Should be in the format of a Resource ID.')
param remoteVirtualNetworkResourceId string

Expand All @@ -25,6 +28,25 @@ param doNotVerifyRemoteGateways bool = true
@description('Optional. If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. Default is false.')
param useRemoteGateways bool = false

#disable-next-line no-deployments-resources
resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableTelemetry) {
name: '46d3xbcp.res.network-virtualnetwork-peering.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name), 0, 4)}'
properties: {
mode: 'Incremental'
template: {
'$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
contentVersion: '1.0.0.0'
resources: []
outputs: {
telemetry: {
type: 'String'
value: 'For more information, see https://aka.ms/avm/TelemetryInfo'
}
}
}
}
}

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-11-01' existing = {
name: localVnetName
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.41.2.15936",
"templateHash": "6939030350004475953"
"templateHash": "12733308459175495117"
},
"name": "Virtual Network Peerings",
"description": "This module deploys a Virtual Network Peering."
Expand All @@ -24,6 +24,13 @@
"description": "Conditional. The name of the parent Virtual Network to add the peering to. Required if the template is used in a standalone deployment."
}
},
"enableTelemetry": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Optional. Enable/Disable usage telemetry for module."
}
},
"remoteVirtualNetworkResourceId": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -67,6 +74,26 @@
}
},
"resources": [
{
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2024-03-01",
"name": "[format('46d3xbcp.res.network-virtualnetwork-peering.{0}.{1}', replace('-..--..-', '.', '-'), substring(uniqueString(deployment().name), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [],
"outputs": {
"telemetry": {
"type": "String",
"value": "For more information, see https://aka.ms/avm/TelemetryInfo"
}
}
}
}
},
{
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"apiVersion": "2024-01-01",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"avm/res/network/private-dns-zone/txt",
"avm/res/network/private-dns-zone/virtual-network-link",
"avm/res/network/virtual-network/subnet",
"avm/res/network/virtual-network/virtual-network-peering",
"avm/res/service-bus/namespace/queue",
"avm/res/service-bus/namespace/topic",
"avm/res/sql/server/database",
Expand Down