forked from luxu-ms/Devbox-ADE-Infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.bicep
49 lines (41 loc) · 1.75 KB
/
main.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var vnetAddressPrefixes = '10.4.0.0/16'
var subnetAddressPrefixes = '10.4.0.0/24'
@description('The user or group id that will be granted to Devcenter Dev Box User role')
param principalId string = ''
@description('The type of principal id: User, Group or ServicePrincipal')
param principalType string = 'User'
@description('Primary location for all resources e.g. eastus')
param location string = resourceGroup().location
var abbrs = loadJsonContent('./abbreviations.json')
var resourceToken = toLower(uniqueString(resourceGroup().id, location))
var ncName = '${abbrs.networkConnections}${resourceToken}'
module vnet 'core/vnet.bicep' = {
name: 'vnet'
params: {
location: location
vnetAddressPrefixes: vnetAddressPrefixes
vnetName: '${abbrs.networkVirtualNetworks}${resourceToken}'
subnetAddressPrefixes: subnetAddressPrefixes
subnetName: '${abbrs.networkVirtualNetworksSubnets}${resourceToken}'
}
}
module devcenter 'core/devcenter.bicep' = {
name: 'devcenter'
params: {
location: location
devcenterName: '${abbrs.devcenter}${resourceToken}'
subnetId: vnet.outputs.subnetId
networkConnectionName: ncName
projectName: '${abbrs.devcenterProject}${resourceToken}'
networkingResourceGroupName: '${abbrs.devcenterNetworkingResourceGroup}${ncName}-${location}'
principalId: principalId
principalType: principalType
}
}
output vnetName string = vnet.outputs.vnetName
output subnetName string = vnet.outputs.subnetName
output devcetnerName string = devcenter.outputs.devcenterName
output projectName string = devcenter.outputs.projectName
output networkConnectionName string = devcenter.outputs.networkConnectionName
output definitions array = devcenter.outputs.definitions
output pools array = devcenter.outputs.poolNames