-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
50 lines (48 loc) · 1.03 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
50
//Array Lookup of a complex object
var subnetArray = [
'GatewaySubnet'
'AzureBastionSubnet'
'AzureFirewallSubnet'
'websubnet'
'appsubnet'
'sqlsubnet'
]
//This complex object is used for lookups.
var subnetObj = {
GatewaySubnet: {
NSG: false
RouteTable: true
AddressSpace: '10.1.0.0/27'
}
AzureBastionSubnet: {
NSG: false
RouteTable: false
AddressSpace: '10.1.0.33/27'
}
AzureFirewallSubnet: {
NSG: false
RouteTable: false
AddressSpace: '10.1.0.33/27'
}
websubnet: {
NSG: true
RouteTable: true
AddressSpace: '10.1.1.0/24'
}
appsubnet: {
NSG: true
RouteTable: true
AddressSpace: '10.1.2.0/24'
}
sqlsubnet: {
NSG: true
RouteTable: true
AddressSpace: '10.1.3.0/24'
}
}
output bicepObject array = [for (name, i) in subnetArray: {
name: subnetArray[i]
AddressSpace: subnetObj[subnetArray[i]].AddressSpace
NSG: subnetObj[subnetArray[i]].NSG
RouteTable: subnetObj[subnetArray[i]].RouteTable
}]