Last active
November 13, 2025 16:10
-
-
Save riosengineer/905030165c3b3273386620f32bacd00a to your computer and use it in GitHub Desktop.
bicep-ephemeral-hub-vnet-demo
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
| targetScope = 'subscription' | |
| param parLocation string | |
| param parResourceGroupName string | |
| param parVirtualNetworkName string | |
| param parAddressSpace string | |
| param parSubnetCidr int | |
| param parSubnetCount int | |
| var varSubnets = [ | |
| for i in range(0, parSubnetCount): { | |
| name: 'subnet-${i}' | |
| addressPrefix: cidrSubnet(parAddressSpace, parSubnetCidr, i) | |
| } | |
| ] | |
| // modules | |
| module modResourceGroup 'br/public:avm/res/resources/resource-group:0.4.2' = { | |
| name: 'deployHubResourceGroup' | |
| params: { | |
| name: parResourceGroupName | |
| location: parLocation | |
| } | |
| } | |
| module modHubVirtualNetwork 'br/public:avm/res/network/virtual-network:0.7.1' = { | |
| name: 'deployHubVirtualNetwork' | |
| scope: resourceGroup(parResourceGroupName) | |
| dependsOn: [ | |
| modResourceGroup | |
| ] | |
| params: { | |
| name: parVirtualNetworkName | |
| location: parLocation | |
| addressPrefixes: [ | |
| parAddressSpace | |
| ] | |
| subnets: varSubnets | |
| } | |
| } | |
| // outputs | |
| output outHubVirtualNetworkId string = modHubVirtualNetwork.outputs.resourceId | |
| output outHubVirtualNetworkSubnets array = modHubVirtualNetwork.outputs.subnetResourceIds | |
| output outHubVirtualNetworkName string = modHubVirtualNetwork.outputs.name | |
| output outHubResourceGroupName string = modResourceGroup.outputs.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment