Skip to content

Instantly share code, notes, and snippets.

@gbaeke
Created May 31, 2021 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbaeke/713f0ea14e27ac89e298f4119d560d62 to your computer and use it in GitHub Desktop.
Save gbaeke/713f0ea14e27ac89e298f4119d560d62 to your computer and use it in GitHub Desktop.
resource vnet1 'Microsoft.Network/virtualNetworks@2020-11-01' = {
name: 'vnet1'
location: resourceGroup().location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.10.0/24'
]
}
subnets:[
{
name: 'servers'
properties:{
addressPrefix: '10.0.10.0/25'
}
}
]
}
}
resource vnet2 'Microsoft.Network/virtualNetworks@2020-11-01' = {
name: 'vnet2'
location: resourceGroup().location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.11.0/24'
]
}
subnets:[
{
name: 'servers'
properties:{
addressPrefix: '10.0.11.0/25'
}
}
]
}
}
resource peer_vnet1_vnet2 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2020-11-01' = {
name: 'peer_vnet1_vnet2'
parent: vnet1
dependsOn:[
vnet1
vnet2
]
properties:{
remoteVirtualNetwork: {
id: vnet2.id
}
allowVirtualNetworkAccess: true
}
}
resource peer_vnet2_vnet1 'Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2020-11-01' = {
name: 'peer_vnet2_vnet1'
parent: vnet2
dependsOn:[
vnet1
vnet2
]
properties:{
remoteVirtualNetwork: {
id: vnet1.id
}
allowVirtualNetworkAccess: true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment