Skip to content

Instantly share code, notes, and snippets.

@johnlokerse
Created February 20, 2022 14:50
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 johnlokerse/04f7e6404c6d1d1aaee50e41614ede48 to your computer and use it in GitHub Desktop.
Save johnlokerse/04f7e6404c6d1d1aaee50e41614ede48 to your computer and use it in GitHub Desktop.
param virtualNetworkName string
param subnetName string
resource myVnet 'Microsoft.Network/virtualNetworks@2019-11-01' = if (!empty(virtualNetworkName)) {
name: virtualNetworkName
location: resourceGroup().location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: !empty(subnetName) ? subnetName : 'myFalseConditionName'
properties: {
addressPrefix: '10.0.0.0/24'
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment