-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainTemplate.json
266 lines (266 loc) · 9.29 KB
/
mainTemplate.json
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminCIDR": {
"type": "string",
"defaultValue": "none",
"metadata": {
"description": "A valid IP range in CIDR notation to allow administrative traffic from, or 'none'."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the root/admin account on deployed virtual machine(s)."
}
},
"appliancesCount": {
"type": "int",
"metadata": {
"description": "Indicates the number of SMA appliance instances to be deployed."
}
},
"appliancesSize": {
"type": "string",
"defaultValue": "none",
"metadata": {
"description": "Instance size of appliance VMs to be deployed, or 'none' if Appliances Count is 0."
}
},
"CMSDeploy": {
"type": "bool",
"metadata": {
"description": "Deploy a CMS instance to manage deployed appliances?"
}
},
"CMSSize": {
"type": "string",
"defaultValue": "none",
"metadata": {
"description": "Instance size of CMS VM to be deployed, or 'none' if CMS Deploy is false."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"smaBranch": {
"type": "string",
"metadata": {
"description": "SMA1000 branch to be deployed."
}
},
"sshPublicKey": {
"type": "securestring",
"metadata": {
"description": "Deployed virtual machines will have this public key added to the admin user's authorized_keys."
}
},
"subnetCIDR": {
"type": "string",
"metadata": {
"description": "A valid network address in CIDR notation to be used for the deployed subnet. Must be contained within the specified virtual network."
}
},
"subnetName": {
"type": "string",
"metadata": {
"description": "Name of the subnet to deploy appliance(s) to."
}
},
"subnetResourceGroup": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "Name of the resource group the subnet will be created in or for an existing subnet the resource group it is in."
}
},
"virtualNetworkCIDR": {
"type": "string",
"metadata": {
"description": "A valid network address in CIDR notation to be used for the deployed virtual network."
}
},
"virtualNetworkCreate": {
"type": "bool",
"metadata": {
"description": "Indicates if the virtual network already exists or if it needs to be created."
}
},
"virtualNetworkName": {
"type": "string",
"metadata": {
"description": "Name of the virtual network to deploy appliance(s) to."
}
},
"vpnAccessCIDR": {
"type": "string",
"defaultValue": "0.0.0.0/0",
"metadata": {
"description": "Allow access to VPN and Workplace resources to this IP range, or 'none' if Appliances Count is 0."
}
}
},
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"name": "sma1000-deployment-network",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/rmeder/SMA-1000-ARM-Templates/master/nestedtemplates/networkTemplate.json"
},
"parameters": {
"adminCIDR": {
"value": "[parameters('adminCIDR')]"
},
"createCentralManagementSecurityRules": {
"value": "[and(parameters('CMSDeploy'), greater(parameters('appliancesCount'), 0))]"
},
"createVpnSecurityRules": {
"value": "[greater(parameters('appliancesCount'), 0)]"
},
"location": {
"value": "[parameters('location')]"
},
"subnetCIDR": {
"value": "[parameters('subnetCIDR')]"
},
"subnetName": {
"value": "[parameters('subnetName')]"
},
"virtualNetworkCIDR": {
"value": "[parameters('virtualNetworkCIDR')]"
},
"virtualNetworkCreate": {
"value": "[parameters('virtualNetworkCreate')]"
},
"virtualNetworkName": {
"value": "[parameters('virtualNetworkName')]"
},
"vpnAccessCIDR": {
"value": "[parameters('vpnAccessCIDR')]"
}
}
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"name": "[concat('sma1000-deployment-appliances-', copyIndex('sma1000-deployment-appliances-copy', 1))]",
"dependsOn": [
"sma1000-deployment-network"
],
"copy": {
"name": "sma1000-deployment-appliances-copy",
"count": "[parameters('appliancesCount')]"
},
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/rmeder/SMA-1000-ARM-Templates/master/nestedtemplates/smaTemplate.json"
},
"parameters": {
"adminPassword": {
"value": "[parameters('adminPassword')]"
},
"applicationSecurityGroupIds": {
"value": "[concat(array(reference('sma1000-deployment-network').outputs.vpnSecurityGroupId.value), if(not(empty(reference('sma1000-deployment-network').outputs.allSecurityGroupId.value)), array(reference('sma1000-deployment-network').outputs.allSecurityGroupId.value), json('[]')), if(not(empty(reference('sma1000-deployment-network').outputs.centralManagementSecurityGroupId.value)), array(reference('sma1000-deployment-network').outputs.centralManagementSecurityGroupId.value), json('[]')))]"
},
"centralManagementEnabled": {
"value": "[parameters('CMSDeploy')]"
},
"location": {
"value": "[parameters('location')]"
},
"networkSecurityGroupId": {
"value": "[reference('sma1000-deployment-network').outputs.networkSecurityGroupId.value]"
},
"product": {
"value": "SMA"
},
"smaBranch": {
"value": "[parameters('smaBranch')]"
},
"sshPublicKey": {
"value": "[parameters('sshPublicKey')]"
},
"subnetId": {
"value": "[resourceId(parameters('subnetResourceGroup'), 'Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('subnetName'))]"
},
"virtualMachineName": {
"value": "[concat('vm-', 'sma1000-', padLeft(copyIndex('sma1000-deployment-appliances-copy', 1), 3, '0'))]"
},
"virtualMachineSize": {
"value": "[parameters('appliancesSize')]"
}
}
}
},
{
"condition": "[parameters('CMSDeploy')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"name": "sma1000-deployment-cms",
"dependsOn": [
"sma1000-deployment-network"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://raw.githubusercontent.com/rmeder/SMA-1000-ARM-Templates/master/nestedtemplates/smaTemplate.json"
},
"parameters": {
"adminPassword": {
"value": "[parameters('adminPassword')]"
},
"applicationSecurityGroupIds": {
"value": "[concat(if(not(empty(reference('sma1000-deployment-network').outputs.allSecurityGroupId.value)), array(reference('sma1000-deployment-network').outputs.allSecurityGroupId.value), json('[]')), if(not(empty(reference('sma1000-deployment-network').outputs.centralManagementSecurityGroupId.value)), array(reference('sma1000-deployment-network').outputs.centralManagementSecurityGroupId.value), json('[]')))]"
},
"location": {
"value": "[parameters('location')]"
},
"networkSecurityGroupId": {
"value": "[reference('sma1000-deployment-network').outputs.networkSecurityGroupId.value]"
},
"product": {
"value": "CMS"
},
"smaBranch": {
"value": "[parameters('smaBranch')]"
},
"sshPublicKey": {
"value": "[parameters('sshPublicKey')]"
},
"subnetId": {
"value": "[resourceId(parameters('subnetResourceGroup'), 'Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('subnetName'))]"
},
"virtualMachineName": {
"value": "vm-sma1000cms-001"
},
"virtualMachineSize": {
"value": "[parameters('CMSSize')]"
}
}
}
},
{
"apiVersion": "2020-06-01",
"name": "pid-a1b33024-6e5e-4c03-912e-e8db1c4f6361-partnercenter",
"type": "Microsoft.Resources/deployments",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": []
}
}
}
]
}