-
Notifications
You must be signed in to change notification settings - Fork 133
/
mlz.bicep
660 lines (567 loc) · 28.6 KB
/
mlz.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
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
// scope
targetScope = 'subscription'
// main
//// scaffolding
module hubResourceGroup './modules/resourceGroup.bicep' = {
name: 'deploy-hub-rg-${nowUtc}'
scope: subscription(hubSubscriptionId)
params: {
name: hubResourceGroupName
location: hubLocation
tags: tags
}
}
module identityResourceGroup './modules/resourceGroup.bicep' = {
name: 'deploy-identity-rg-${nowUtc}'
scope: subscription(identitySubscriptionId)
params: {
name: identityResourceGroupName
location: identityLocation
tags: tags
}
}
module operationsResourceGroup './modules/resourceGroup.bicep' = {
name: 'deploy-operations-rg-${nowUtc}'
scope: subscription(operationsSubscriptionId)
params: {
name: operationsResourceGroupName
location: operationsLocation
tags: tags
}
}
module sharedServicesResourceGroup './modules/resourceGroup.bicep' = {
name: 'deploy-sharedServices-rg-${nowUtc}'
scope: subscription(sharedServicesSubscriptionId)
params: {
name: sharedServicesResourceGroupName
location: sharedServicesLocation
tags: tags
}
}
//// logging
module logAnalyticsWorkspace './modules/logAnalyticsWorkspace.bicep' = {
name: 'deploy-laws-${nowUtc}'
scope: resourceGroup(operationsSubscriptionId, operationsResourceGroupName)
params: {
name: logAnalyticsWorkspaceName
location: logAnalyticsWorkspaceLocation
tags: tags
retentionInDays: logAnalyticsWorkspaceRetentionInDays
skuName: logAnalyticsWorkspaceSkuName
workspaceCappingDailyQuotaGb: logAnalyticsWorkspaceCappingDailyQuotaGb
}
dependsOn: [
operationsResourceGroup
]
}
//// hub and spoke
module hub './modules/hubNetwork.bicep' = {
name: 'deploy-hub-${nowUtc}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
params: {
location: hubLocation
tags: tags
logStorageAccountName: hubLogStorageAccountName
logStorageSkuName: hubLogStorageSkuName
logAnalyticsWorkspaceName: logAnalyticsWorkspaceName
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspace.outputs.id
virtualNetworkName: hubVirtualNetworkName
virtualNetworkAddressPrefix: hubVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: hubVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: hubVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: hubNetworkSecurityGroupName
networkSecurityGroupRules: hubNetworkSecurityGroupRules
subnetName: hubSubnetName
subnetAddressPrefix: hubSubnetAddressPrefix
subnetServiceEndpoints: hubSubnetServiceEndpoints
firewallName: firewallName
firewallSkuTier: firewallSkuTier
firewallPolicyName: firewallPolicyName
firewallThreatIntelMode: firewallThreatIntelMode
firewallClientIpConfigurationName: firewallClientIpConfigurationName
firewallClientSubnetName: firewallClientSubnetName
firewallClientSubnetAddressPrefix: firewallClientSubnetAddressPrefix
firewallClientSubnetServiceEndpoints: firewallClientSubnetServiceEndpoints
firewallClientPublicIPAddressName: firewallClientPublicIPAddressName
firewallClientPublicIPAddressSkuName: firewallClientPublicIPAddressSkuName
firewallClientPublicIpAllocationMethod: firewallClientPublicIpAllocationMethod
firewallClientPublicIPAddressAvailabilityZones: firewallClientPublicIPAddressAvailabilityZones
firewallManagementIpConfigurationName: firewallManagementIpConfigurationName
firewallManagementSubnetName: firewallManagementSubnetName
firewallManagementSubnetAddressPrefix: firewallManagementSubnetAddressPrefix
firewallManagementSubnetServiceEndpoints: firewallManagementSubnetServiceEndpoints
firewallManagementPublicIPAddressName: firewallManagementPublicIPAddressName
firewallManagementPublicIPAddressSkuName: firewallManagementPublicIPAddressSkuName
firewallManagementPublicIpAllocationMethod: firewallManagementPublicIpAllocationMethod
firewallManagementPublicIPAddressAvailabilityZones: firewallManagementPublicIPAddressAvailabilityZones
}
}
module identity './modules/spokeNetwork.bicep' = {
name: 'deploy-identity-spoke-${nowUtc}'
scope: resourceGroup(identitySubscriptionId, identityResourceGroupName)
params: {
location: identityLocation
tags: tags
logStorageAccountName: identityLogStorageAccountName
logStorageSkuName: identityLogStorageSkuName
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspace.outputs.id
firewallPrivateIPAddress: hub.outputs.firewallPrivateIPAddress
virtualNetworkName: identityVirtualNetworkName
virtualNetworkAddressPrefix: identityVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: identityVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: identityVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: identityNetworkSecurityGroupName
networkSecurityGroupRules: identityNetworkSecurityGroupRules
subnetName: identitySubnetName
subnetAddressPrefix: identitySubnetAddressPrefix
subnetServiceEndpoints: identitySubnetServiceEndpoints
}
}
module operations './modules/spokeNetwork.bicep' = {
name: 'deploy-operations-spoke-${nowUtc}'
scope: resourceGroup(operationsSubscriptionId, operationsResourceGroupName)
params: {
location: operationsLocation
tags: tags
logStorageAccountName: operationsLogStorageAccountName
logStorageSkuName: operationsLogStorageSkuName
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspace.outputs.id
firewallPrivateIPAddress: hub.outputs.firewallPrivateIPAddress
virtualNetworkName: operationsVirtualNetworkName
virtualNetworkAddressPrefix: operationsVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: operationsVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: operationsVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: operationsNetworkSecurityGroupName
networkSecurityGroupRules: operationsNetworkSecurityGroupRules
subnetName: operationsSubnetName
subnetAddressPrefix: operationsSubnetAddressPrefix
subnetServiceEndpoints: operationsSubnetServiceEndpoints
}
}
module sharedServices './modules/spokeNetwork.bicep' = {
name: 'deploy-sharedServices-spoke-${nowUtc}'
scope: resourceGroup(sharedServicesSubscriptionId, sharedServicesResourceGroupName)
params: {
location: sharedServicesLocation
tags: tags
logStorageAccountName: sharedServicesLogStorageAccountName
logStorageSkuName: sharedServicesLogStorageSkuName
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspace.outputs.id
firewallPrivateIPAddress: hub.outputs.firewallPrivateIPAddress
virtualNetworkName: sharedServicesVirtualNetworkName
virtualNetworkAddressPrefix: sharedServicesVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: sharedServicesVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: sharedServicesVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: sharedServicesNetworkSecurityGroupName
networkSecurityGroupRules: sharedServicesNetworkSecurityGroupRules
subnetName: sharedServicesSubnetName
subnetAddressPrefix: sharedServicesSubnetAddressPrefix
subnetServiceEndpoints: sharedServicesSubnetServiceEndpoints
}
}
//// peering
module hubVirtualNetworkPeerings './modules/hubNetworkPeerings.bicep' = {
name: 'deploy-hub-peerings-${nowUtc}'
scope: subscription(hubSubscriptionId)
params: {
hubResourceGroupName: hubResourceGroup.outputs.name
hubVirtualNetworkName: hub.outputs.virtualNetworkName
identityVirtualNetworkName: identity.outputs.virtualNetworkName
operationsVirtualNetworkName: operations.outputs.virtualNetworkName
sharedServicesVirtualNetworkName: sharedServices.outputs.virtualNetworkName
identityVirtualNetworkResourceId: identity.outputs.virtualNetworkResourceId
operationsVirtualNetworkResourceId: sharedServices.outputs.virtualNetworkResourceId
sharedServicesVirtualNetworkResourceId: operations.outputs.virtualNetworkResourceId
}
}
module identityVirtualNetworkPeering './modules/spokeNetworkPeering.bicep' = {
name: 'deploy-identity-peerings-${nowUtc}'
scope: subscription(identitySubscriptionId)
params: {
spokeResourceGroupName: identityResourceGroup.outputs.name
spokeVirtualNetworkName: identity.outputs.virtualNetworkName
hubVirtualNetworkName: hub.outputs.virtualNetworkName
hubVirtualNetworkResourceId: hub.outputs.virtualNetworkResourceId
}
}
module operationsVirtualNetworkPeering './modules/spokeNetworkPeering.bicep' = {
name: 'deploy-operations-peerings-${nowUtc}'
scope: subscription(operationsSubscriptionId)
params: {
spokeResourceGroupName: operationsResourceGroup.outputs.name
spokeVirtualNetworkName: operations.outputs.virtualNetworkName
hubVirtualNetworkName: hub.outputs.virtualNetworkName
hubVirtualNetworkResourceId: hub.outputs.virtualNetworkResourceId
}
}
module sharedServicesVirtualNetworkPeering './modules/spokeNetworkPeering.bicep' = {
name: 'deploy-sharedServices-peerings-${nowUtc}'
scope: subscription(sharedServicesSubscriptionId)
params: {
spokeResourceGroupName: sharedServicesResourceGroup.outputs.name
spokeVirtualNetworkName: sharedServices.outputs.virtualNetworkName
hubVirtualNetworkName: hub.outputs.virtualNetworkName
hubVirtualNetworkResourceId: hub.outputs.virtualNetworkResourceId
}
}
//// policy
module hubPolicyAssignment './modules/policyAssignment.bicep' = {
name: 'assign-policy-hub-${nowUtc}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
params: {
builtInAssignment: policy
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceGroupName: operationsResourceGroup.outputs.name
operationsSubscriptionId: operationsSubscriptionId
}
}
module operationsPolicyAssignment './modules/policyAssignment.bicep' = {
name: 'assign-policy-operations-${nowUtc}'
scope: resourceGroup(operationsSubscriptionId, operationsResourceGroupName)
params: {
builtInAssignment: policy
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceGroupName: operationsResourceGroup.outputs.name
operationsSubscriptionId: operationsSubscriptionId
}
}
module sharedServicesPolicyAssignment './modules/policyAssignment.bicep' = {
name: 'assign-policy-sharedServices-${nowUtc}'
scope: resourceGroup(sharedServicesSubscriptionId, sharedServicesResourceGroupName)
params: {
builtInAssignment: policy
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceGroupName: operationsResourceGroup.outputs.name
operationsSubscriptionId: operationsSubscriptionId
}
}
module identityPolicyAssignment './modules/policyAssignment.bicep' = {
name: 'assign-policy-identity-${nowUtc}'
scope: resourceGroup(identitySubscriptionId, identityResourceGroupName)
params: {
builtInAssignment: policy
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceGroupName: operationsResourceGroup.outputs.name
operationsSubscriptionId: operationsSubscriptionId
}
}
module hubSubscriptionCreateActivityLogging './modules/centralLogging.bicep' = {
name: 'activity-logs-hub-${nowUtc}'
scope: subscription(hubSubscriptionId)
params: {
diagnosticSettingName: 'log-hub-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
}
}
module operationsSubscriptionCreateActivityLogging './modules/centralLogging.bicep' = if(hubSubscriptionId != operationsSubscriptionId) {
name: 'activity-logs-operations-${nowUtc}'
scope: subscription(operationsSubscriptionId)
params: {
diagnosticSettingName: 'log-operations-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
}
}
module identitySubscriptionCreateActivityLogging './modules/centralLogging.bicep' = if(hubSubscriptionId != identitySubscriptionId) {
name: 'activity-logs-identity-${nowUtc}'
scope: subscription(identitySubscriptionId)
params: {
diagnosticSettingName: 'log-identity-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
}
}
module sharedServicesSubscriptionCreateActivityLogging './modules/centralLogging.bicep' = if(hubSubscriptionId != sharedServicesSubscriptionId) {
name: 'activity-logs-sharedServices-${nowUtc}'
scope: subscription(sharedServicesSubscriptionId)
params: {
diagnosticSettingName: 'log-sharedServices-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
}
}
// operations' log analytic workspace diagnostic logging
module logAnalyticsDiagnosticLogging './modules/logAnalyticsDiagnosticLogging.bicep' = {
name: 'delpoy-diagnostic-logging-LAWS'
scope: resourceGroup(operationsSubscriptionId, operationsResourceGroupName)
params: {
diagnosticStorageAccountName: operationsLogStorageAccountName
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
enableDiagnostics: true
}
dependsOn: [
operations
]
}
// security center per subscription if different per hub/spoke
module hubSecurityCenter './modules/securityCenter.bicep' = if(deployASC){
name: 'set-hub-sub-security-center'
scope: subscription(hubSubscriptionId)
params: {
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
emailSecurityContact: emailSecurityContact
}
}
module operationsSecurityCenter './modules/securityCenter.bicep' = if(deployASC && hubSubscriptionId != operationsSubscriptionId) {
name: 'set-operations-sub-security-center'
scope: subscription(operationsSubscriptionId)
params: {
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
emailSecurityContact: emailSecurityContact
}
}
module identitySecurityCenter './modules/securityCenter.bicep' = if(deployASC && hubSubscriptionId != identitySubscriptionId) {
name: 'set-identity-sub-security-center'
scope: subscription(identitySubscriptionId)
params: {
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
emailSecurityContact: emailSecurityContact
}
}
module sharedServicesSecurityCenter './modules/securityCenter.bicep' = if(deployASC && hubSubscriptionId != sharedServicesSubscriptionId) {
name: 'set-sharedServices-sub-security-center'
scope: subscription(sharedServicesSubscriptionId)
params: {
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
emailSecurityContact: emailSecurityContact
}
}
//// remote access
module remoteAccess './modules/remoteAccess.bicep' = if(deployRemoteAccess) {
name: 'deploy-remote-access-${nowUtc}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
params: {
location: hubLocation
hubVirtualNetworkName: hub.outputs.virtualNetworkName
hubSubnetResourceId: hub.outputs.subnetResourceId
hubNetworkSecurityGroupResourceId: hub.outputs.networkSecurityGroupResourceId
bastionHostName: bastionHostName
bastionHostSubnetAddressPrefix: bastionHostSubnetAddressPrefix
bastionHostPublicIPAddressName: bastionHostPublicIPAddressName
bastionHostPublicIPAddressSkuName: bastionHostPublicIPAddressSkuName
bastionHostPublicIPAddressAllocationMethod: bastionHostPublicIPAddressAllocationMethod
bastionHostPublicIPAddressAvailabilityZones: bastionHostPublicIPAddressAvailabilityZones
bastionHostIPConfigurationName: bastionHostIPConfigurationName
linuxNetworkInterfaceName: linuxNetworkInterfaceName
linuxNetworkInterfaceIpConfigurationName: linuxNetworkInterfaceIpConfigurationName
linuxNetworkInterfacePrivateIPAddressAllocationMethod: linuxNetworkInterfacePrivateIPAddressAllocationMethod
linuxVmName: linuxVmName
linuxVmSize: linuxVmSize
linuxVmOsDiskCreateOption: linuxVmOsDiskCreateOption
linuxVmOsDiskType: linuxVmOsDiskType
linuxVmImagePublisher: linuxVmImagePublisher
linuxVmImageOffer: linuxVmImageOffer
linuxVmImageSku: linuxVmImageSku
linuxVmImageVersion: linuxVmImageVersion
linuxVmAdminUsername: linuxVmAdminUsername
linuxVmAuthenticationType: linuxVmAuthenticationType
linuxVmAdminPasswordOrKey: linuxVmAdminPasswordOrKey
windowsNetworkInterfaceName: windowsNetworkInterfaceName
windowsNetworkInterfaceIpConfigurationName: windowsNetworkInterfaceIpConfigurationName
windowsNetworkInterfacePrivateIPAddressAllocationMethod: windowsNetworkInterfacePrivateIPAddressAllocationMethod
windowsVmName: windowsVmName
windowsVmSize: windowsVmSize
windowsVmAdminUsername: windowsVmAdminUsername
windowsVmAdminPassword: windowsVmAdminPassword
windowsVmPublisher: windowsVmPublisher
windowsVmOffer: windowsVmOffer
windowsVmSku: windowsVmSku
windowsVmVersion: windowsVmVersion
windowsVmCreateOption: windowsVmCreateOption
windowsVmStorageAccountType: windowsVmStorageAccountType
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
}
}
// parameters
@minLength(3)
@maxLength(24)
@description('A name (3-24 alphanumeric characters in length without whitespace) used to prefix resources and generate uniqueness for resources with globally unique naming requirements like Storage Accounts and Log Analytics Workspaces')
param resourcePrefix string = 'mlz-${uniqueId}'
param hubSubscriptionId string = subscription().subscriptionId
param identitySubscriptionId string = hubSubscriptionId
param operationsSubscriptionId string = hubSubscriptionId
param sharedServicesSubscriptionId string = hubSubscriptionId
@allowed([
'Standard'
'Premium'
])
param firewallSkuTier string = 'Premium'
param hubResourceGroupName string = '${resourcePrefix}-hub'
param hubLocation string = deployment().location
param hubVirtualNetworkName string = 'hub-vnet'
param hubSubnetName string = 'hub-subnet'
param hubVirtualNetworkAddressPrefix string = '10.0.100.0/24'
param hubSubnetAddressPrefix string = '10.0.100.128/27'
param hubVirtualNetworkDiagnosticsLogs array = []
param hubVirtualNetworkDiagnosticsMetrics array = []
param hubNetworkSecurityGroupName string = 'hub-nsg'
param hubNetworkSecurityGroupRules array = []
param hubSubnetServiceEndpoints array = []
param hubLogStorageAccountName string = toLower(take('hublogs${uniqueId}', 24))
param hubLogStorageSkuName string = 'Standard_GRS'
param firewallName string = 'firewall'
param firewallManagementSubnetAddressPrefix string = '10.0.100.64/26'
param firewallClientSubnetAddressPrefix string = '10.0.100.0/26'
param firewallPolicyName string = 'firewall-policy'
param firewallThreatIntelMode string = 'Alert'
var firewallClientSubnetName = 'AzureFirewallSubnet' //this must be 'AzureFirewallSubnet'
param firewallClientIpConfigurationName string = 'firewall-client-ip-config'
param firewallClientSubnetServiceEndpoints array = []
param firewallClientPublicIPAddressName string = 'firewall-client-public-ip'
param firewallClientPublicIPAddressSkuName string = 'Standard'
param firewallClientPublicIpAllocationMethod string = 'Static'
param firewallClientPublicIPAddressAvailabilityZones array = []
var firewallManagementSubnetName = 'AzureFirewallManagementSubnet' //this must be 'AzureFirewallManagementSubnet'
param firewallManagementIpConfigurationName string = 'firewall-management-ip-config'
param firewallManagementSubnetServiceEndpoints array = []
param firewallManagementPublicIPAddressName string = 'firewall-management-public-ip'
param firewallManagementPublicIPAddressSkuName string = 'Standard'
param firewallManagementPublicIpAllocationMethod string = 'Static'
param firewallManagementPublicIPAddressAvailabilityZones array = []
param identityResourceGroupName string = replace(hubResourceGroupName, 'hub', 'identity')
param identityLocation string = hubLocation
param identityVirtualNetworkName string = replace(hubVirtualNetworkName, 'hub', 'identity')
param identitySubnetName string = replace(hubSubnetName, 'hub', 'identity')
param identityVirtualNetworkAddressPrefix string = '10.0.110.0/26'
param identitySubnetAddressPrefix string = '10.0.110.0/27'
param identityVirtualNetworkDiagnosticsLogs array = []
param identityVirtualNetworkDiagnosticsMetrics array = []
param identityNetworkSecurityGroupName string = replace(hubNetworkSecurityGroupName, 'hub', 'identity')
param identityNetworkSecurityGroupRules array = []
param identitySubnetServiceEndpoints array = []
param identityLogStorageAccountName string = toLower(take('idlogs${uniqueId}', 24))
param identityLogStorageSkuName string = hubLogStorageSkuName
param operationsResourceGroupName string = replace(hubResourceGroupName, 'hub', 'operations')
param operationsLocation string = hubLocation
param operationsVirtualNetworkName string = replace(hubVirtualNetworkName, 'hub', 'operations')
param operationsVirtualNetworkAddressPrefix string = '10.0.115.0/26'
param operationsVirtualNetworkDiagnosticsLogs array = []
param operationsVirtualNetworkDiagnosticsMetrics array = []
param operationsNetworkSecurityGroupName string = replace(hubNetworkSecurityGroupName, 'hub', 'operations')
param operationsNetworkSecurityGroupRules array = []
param operationsSubnetName string = replace(hubSubnetName, 'hub', 'operations')
param operationsSubnetAddressPrefix string = '10.0.115.0/27'
param operationsSubnetServiceEndpoints array = []
param operationsLogStorageAccountName string = toLower(take('opslogs${uniqueId}', 24))
param operationsLogStorageSkuName string = hubLogStorageSkuName
param sharedServicesResourceGroupName string = replace(hubResourceGroupName, 'hub', 'sharedServices')
param sharedServicesLocation string = hubLocation
param sharedServicesVirtualNetworkName string = replace(hubVirtualNetworkName, 'hub', 'sharedServices')
param sharedServicesSubnetName string = replace(hubSubnetName, 'hub', 'sharedServices')
param sharedServicesVirtualNetworkAddressPrefix string = '10.0.120.0/26'
param sharedServicesSubnetAddressPrefix string = '10.0.120.0/27'
param sharedServicesVirtualNetworkDiagnosticsLogs array = []
param sharedServicesVirtualNetworkDiagnosticsMetrics array = []
param sharedServicesNetworkSecurityGroupName string = replace(hubNetworkSecurityGroupName, 'hub', 'sharedServices')
param sharedServicesNetworkSecurityGroupRules array = []
param sharedServicesSubnetServiceEndpoints array = []
param sharedServicesLogStorageAccountName string = toLower(take('shrdSvclogs${uniqueId}', 24))
param sharedServicesLogStorageSkuName string = hubLogStorageSkuName
param logAnalyticsWorkspaceName string = take('${resourcePrefix}-laws', 63)
param logAnalyticsWorkspaceLocation string = operationsLocation
param logAnalyticsWorkspaceCappingDailyQuotaGb int = -1
param logAnalyticsWorkspaceRetentionInDays int = 30
param logAnalyticsWorkspaceSkuName string = 'PerGB2018'
@allowed([
'NIST'
'IL5' // Gov cloud only, trying to deploy IL5 in AzureCloud will switch to NIST
'CMMC'
''
])
@description('Built-in policy assignments to assign, default is none. [NIST/IL5/CMMC] IL5 is only availalbe for GOV cloud and will switch to NIST if tried in AzureCloud.')
param policy string = ''
@description('Email address of the contact, in the form of john@doe.com')
param emailSecurityContact string = ''
param deployASC bool = false
@description('Provision Azure Bastion Host and jumpboxes in this deployment')
param deployRemoteAccess bool = false
param bastionHostName string = 'bastionHost'
param bastionHostSubnetAddressPrefix string = '10.0.100.160/27'
param bastionHostPublicIPAddressName string = 'bastionHostPublicIPAddress'
param bastionHostPublicIPAddressSkuName string = 'Standard'
param bastionHostPublicIPAddressAllocationMethod string = 'Static'
param bastionHostPublicIPAddressAvailabilityZones array = []
param bastionHostIPConfigurationName string = 'bastionHostIPConfiguration'
param linuxNetworkInterfaceName string = 'linuxVmNetworkInterface'
param linuxNetworkInterfaceIpConfigurationName string = 'linuxVmIpConfiguration'
param linuxNetworkInterfacePrivateIPAddressAllocationMethod string = 'Dynamic'
param linuxVmName string = 'linuxVirtualMachine'
param linuxVmSize string = 'Standard_B2s'
param linuxVmOsDiskCreateOption string = 'FromImage'
param linuxVmOsDiskType string = 'Standard_LRS'
param linuxVmImagePublisher string = 'Canonical'
param linuxVmImageOffer string = 'UbuntuServer'
param linuxVmImageSku string = '18.04-LTS'
param linuxVmImageVersion string = 'latest'
param linuxVmAdminUsername string = 'azureuser'
@allowed([
'sshPublicKey'
'password'
])
param linuxVmAuthenticationType string = 'password'
@secure()
@minLength(14)
param linuxVmAdminPasswordOrKey string = deployRemoteAccess ? '' : newGuid()
param windowsNetworkInterfaceName string = 'windowsVmNetworkInterface'
param windowsNetworkInterfaceIpConfigurationName string = 'windowsVmIpConfiguration'
param windowsNetworkInterfacePrivateIPAddressAllocationMethod string = 'Dynamic'
param windowsVmName string = 'windowsVm'
param windowsVmSize string = 'Standard_DS1_v2'
param windowsVmAdminUsername string = 'azureuser'
@secure()
@minLength(14)
param windowsVmAdminPassword string = deployRemoteAccess ? '' : newGuid()
param windowsVmPublisher string = 'MicrosoftWindowsServer'
param windowsVmOffer string = 'WindowsServer'
param windowsVmSku string = '2019-datacenter'
param windowsVmVersion string = 'latest'
param windowsVmCreateOption string = 'FromImage'
param windowsVmStorageAccountType string = 'StandardSSD_LRS'
param tags object = {
'resourcePrefix': resourcePrefix
'DeploymentType': 'MissionLandingZoneARM'
}
param uniqueId string = uniqueString(deployment().name)
param nowUtc string = utcNow()
// outputs
output hubSubscriptionId string = hubSubscriptionId
output hubResourceGroupName string = hubResourceGroup.outputs.name
output hubResourceGroupResourceId string = hubResourceGroup.outputs.id
output hubVirtualNetworkName string = hub.outputs.virtualNetworkName
output hubVirtualNetworkResourceId string = hub.outputs.virtualNetworkResourceId
output hubSubnetName string = hub.outputs.subnetName
output hubSubnetResourceId string = hub.outputs.subnetResourceId
output hubSubnetAddressPrefix string = hub.outputs.subnetAddressPrefix
output hubNetworkSecurityGroupName string = hub.outputs.networkSecurityGroupName
output hubNetworkSecurityGroupResourceId string = hub.outputs.networkSecurityGroupResourceId
output hubFirewallPrivateIPAddress string = hub.outputs.firewallPrivateIPAddress
output logAnalyticsWorkspaceName string = logAnalyticsWorkspace.outputs.name
output logAnalyticsWorkspaceResourceId string = logAnalyticsWorkspace.outputs.id
output firewallPrivateIPAddress string = hub.outputs.firewallPrivateIPAddress
output identitySubscriptionId string = identitySubscriptionId
output identityResourceGroupName string = identityResourceGroup.outputs.name
output identityResourceGroupResourceId string = identityResourceGroup.outputs.id
output identityVirtualNetworkName string = identity.outputs.virtualNetworkName
output identityVirtualNetworkResourceId string = identity.outputs.virtualNetworkResourceId
output identitySubnetName string = identity.outputs.subnetName
output identitySubnetResourceId string = identity.outputs.subnetResourceId
output identitySubnetAddressPrefix string = identity.outputs.subnetAddressPrefix
output identityNetworkSecurityGroupName string = identity.outputs.networkSecurityGroupName
output identityNetworkSecurityGroupResourceId string = identity.outputs.networkSecurityGroupResourceId
output operationsSubscriptionId string = operationsSubscriptionId
output operationsResourceGroupName string = operationsResourceGroup.outputs.name
output operationsResourceGroupResourceId string = operationsResourceGroup.outputs.id
output operationsVirtualNetworkName string = operations.outputs.virtualNetworkName
output operationsVirtualNetworkResourceId string = operations.outputs.virtualNetworkResourceId
output operationsSubnetName string = operations.outputs.subnetName
output operationsSubnetResourceId string = operations.outputs.subnetResourceId
output operationsSubnetAddressPrefix string = operations.outputs.subnetAddressPrefix
output operationsNetworkSecurityGroupName string = operations.outputs.networkSecurityGroupName
output operationsNetworkSecurityGroupResourceId string = operations.outputs.networkSecurityGroupResourceId
output sharedServicesSubscriptionId string = sharedServicesSubscriptionId
output sharedServicesResourceGroupName string = sharedServicesResourceGroup.outputs.name
output sharedServicesResourceGroupResourceId string = sharedServicesResourceGroup.outputs.id
output sharedServicesVirtualNetworkName string = sharedServices.outputs.virtualNetworkName
output sharedServicesVirtualNetworkResourceId string = sharedServices.outputs.virtualNetworkResourceId
output sharedServicesSubnetName string = sharedServices.outputs.subnetName
output sharedServicesSubnetResourceId string = sharedServices.outputs.subnetResourceId
output sharedServicesSubnetAddressPrefix string = sharedServices.outputs.subnetAddressPrefix
output sharedServicesNetworkSecurityGroupName string = sharedServices.outputs.networkSecurityGroupName
output sharedServicesNetworkSecurityGroupResourceId string = sharedServices.outputs.networkSecurityGroupResourceId