-
-
Save johnlokerse/e419e1a096ae08ea533a8b81f1bc8919 to your computer and use it in GitHub Desktop.
Subnetting blog
This file contains 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
@description('The preferred IP address space for the virtual network. Add the CIDR. Default: 192.168.1.0/24') | |
param parAddressSpace string = '192.168.1.0/24' | |
@description('The preferred CIDR for the subnet. Default: 25') | |
param parSubnetCidr int = 25 | |
@description('The amount of subnets to create. Default: 2') | |
param parAmountOfSubnets int = 2 | |
var varSubnetCalculations = map(range(0, parAmountOfSubnets), i => { | |
name: 'subnet-${i}' | |
properties: { | |
addressPrefix: cidrSubnet(parAddressSpace, parSubnetCidr, i) | |
} | |
}) | |
resource resVirtualNetwork 'microsoft.network/virtualNetworks@2019-11-01' = { | |
name: 'my-vnet2' | |
location: 'westeurope' | |
properties: { | |
addressSpace: { | |
addressPrefixes: [ | |
parAddressSpace | |
] | |
} | |
subnets: varSubnetCalculations | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment