-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmlz.bicep
1134 lines (929 loc) · 50.4 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
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
*/
targetScope = 'subscription'
/*
PARAMETERS
Here are all the parameters a user can override.
These are the required parameters that Mission LZ does not provide a default for:
- resourcePrefix
*/
// REQUIRED PARAMETERS
@minLength(3)
@maxLength(10)
@description('A prefix, 3-10 alphanumeric characters 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
@minLength(3)
@maxLength(6)
@description('A suffix, 3 to 6 characters in length, to append to resource names (e.g. "dev", "test", "prod", "mlz"). It defaults to "mlz".')
param resourceSuffix string = 'mlz'
@description('The subscription ID for the Hub Network and resources. It defaults to the deployment subscription.')
param hubSubscriptionId string = subscription().subscriptionId
@description('The subscription ID for the Identity Network and resources. It defaults to the deployment subscription.')
param identitySubscriptionId string = subscription().subscriptionId
@description('The subscription ID for the Operations Network and resources. It defaults to the deployment subscription.')
param operationsSubscriptionId string = subscription().subscriptionId
@description('The subscription ID for the Shared Services Network and resources. It defaults to the deployment subscription.')
param sharedServicesSubscriptionId string = subscription().subscriptionId
@description('The subscription ID for the On-Prem Network and resources. It defaults to the deployment subscription.')
param onPremSubscriptionId string = subscription().subscriptionId
@description('The subscription ID for the T3 Network and resources. It defaults to the deployment subscription.')
param t3SubscriptionId string = subscription().subscriptionId
@description('The region to deploy resources into. It defaults to the deployment location.')
param location string = 'mlz'
// RESOURCE NAMING PARAMETERS
@description('A suffix to use for naming deployments uniquely. It defaults to the Bicep resolution of the "utcNow()" function.')
param deploymentNameSuffix string = utcNow()
@description('A string dictionary of tags to add to deployed resources. See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json#arm-templates for valid settings.')
param tags object = {}
// NETWORK ADDRESS SPACE PARAMETERS
@description('The CIDR Virtual Network Address Prefix for the Hub Virtual Network.')
param hubVirtualNetworkAddressPrefix string = '10.0.100.0/24'
@description('The CIDR Subnet Address Prefix for the default Hub subnet. It must be in the Hub Virtual Network space.')
param hubSubnetAddressPrefix string = '10.0.100.128/27'
@description('The CIDR Subnet Address Prefix for the Azure Firewall Subnet. It must be in the Hub Virtual Network space. It must be /26.')
param firewallClientSubnetAddressPrefix string = '10.0.100.0/26'
@description('The CIDR Subnet Address Prefix for the Azure Firewall Management Subnet. It must be in the Hub Virtual Network space. It must be /26.')
param firewallManagementSubnetAddressPrefix string = '10.0.100.64/26'
@description('The CIDR Virtual Network Address Prefix for the Identity Virtual Network.')
param identityVirtualNetworkAddressPrefix string = '10.0.110.0/26'
@description('The CIDR Subnet Address Prefix for the default Identity subnet. It must be in the Identity Virtual Network space.')
param identitySubnetAddressPrefix string = '10.0.110.0/27'
@description('The CIDR Virtual Network Address Prefix for the Operations Virtual Network.')
param operationsVirtualNetworkAddressPrefix string = '10.0.115.0/26'
@description('The CIDR Subnet Address Prefix for the default Operations subnet. It must be in the Operations Virtual Network space.')
param operationsSubnetAddressPrefix string = '10.0.115.0/27'
@description('The CIDR Virtual Network Address Prefix for the Shared Services Virtual Network.')
param sharedServicesVirtualNetworkAddressPrefix string = '10.0.120.0/26'
@description('The CIDR Subnet Address Prefix for the default Shared Services subnet. It must be in the Shared Services Virtual Network space.')
param sharedServicesSubnetAddressPrefix string = '10.0.120.0/27'
@description('The CIDR Virtual Network Address Prefix for the On-Prem Virtual Network.')
param onPremVirtualNetworkAddressPrefix string = '10.0.121.0/26'
@description('The CIDR Subnet Address Prefix for the default On-Prem subnet. It must be in the On-Prem Virtual Network space.')
param onPremSubnetAddressPrefix string = '10.0.121.0/27'
@description('The CIDR Virtual Network Address Prefix for the T3 Virtual Network.')
param t3VirtualNetworkAddressPrefix string = '10.0.122.0/26'
@description('The CIDR Subnet Address Prefix for the default T3 subnet. It must be in the T3 Virtual Network space.')
param t3SubnetAddressPrefix string = '10.0.122.0/27'
// FIREWALL PARAMETERS
@allowed([
'Standard'
])
@description('[Standard/Premium] The SKU for Azure Firewall. It defaults to "Premium".')
param firewallSkuTier string = 'Standard'
@allowed([
'Alert'
'Deny'
'Off'
])
@description('[Alert/Deny/Off] The Azure Firewall Threat Intelligence Rule triggered logging behavior. Valid values are "Alert", "Deny", or "Off". The default value is "Alert".')
param firewallThreatIntelMode string = 'Alert'
@description('An array of Firewall Diagnostic Logs categories to collect. See "https://docs.microsoft.com/en-us/azure/firewall/firewall-diagnostics#enable-diagnostic-logging-through-the-azure-portal" for valid values.')
param firewallDiagnosticsLogs array = [
{
category: 'AzureFirewallApplicationRule'
enabled: true
}
{
category: 'AzureFirewallNetworkRule'
enabled: true
}
{
category: 'AzureFirewallDnsProxy'
enabled: true
}
]
@description('An array of Firewall Diagnostic Metrics categories to collect. See "https://docs.microsoft.com/en-us/azure/firewall/firewall-diagnostics#enable-diagnostic-logging-through-the-azure-portal" for valid values.')
param firewallDiagnosticsMetrics array = [
{
category: 'AllMetrics'
enabled: true
}
]
@description('An array of Service Endpoints to enable for the Azure Firewall Client Subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param firewallClientSubnetServiceEndpoints array = []
@description('An array of Azure Firewall Public IP Address Availability Zones. It defaults to empty, or "No-Zone", because Availability Zones are not available in every cloud. See https://docs.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses#sku for valid settings.')
param firewallClientPublicIPAddressAvailabilityZones array = []
@description('An array of Service Endpoints to enable for the Azure Firewall Management Subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param firewallManagementSubnetServiceEndpoints array = []
@description('An array of Azure Firewall Public IP Address Availability Zones. It defaults to empty, or "No-Zone", because Availability Zones are not available in every cloud. See https://docs.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses#sku for valid settings.')
param firewallManagementPublicIPAddressAvailabilityZones array = []
@description('Supernet CIDR address for the entire network of vnets, this address allows for communication between spokes. Recommended to use a Supernet calculator if modifying vnet addresses')
param firewallSupernetIPAddress string = '10.0.96.0/19'
@description('An array of Public IP Address Diagnostic Logs for the Azure Firewall. See https://docs.microsoft.com/en-us/azure/ddos-protection/diagnostic-logging?tabs=DDoSProtectionNotifications#configure-ddos-diagnostic-logs for valid settings.')
param publicIPAddressDiagnosticsLogs array = [
{
category: 'DDoSProtectionNotifications'
enabled: true
}
{
category: 'DDoSMitigationFlowLogs'
enabled: true
}
{
category: 'DDoSMitigationReports'
enabled: true
}
]
@description('An array of Public IP Address Diagnostic Metrics for the Azure Firewall. See https://docs.microsoft.com/en-us/azure/ddos-protection/diagnostic-logging?tabs=DDoSProtectionNotifications for valid settings.')
param publicIPAddressDiagnosticsMetrics array = [
{
category: 'AllMetrics'
enabled: true
}
]
// HUB NETWORK PARAMETERS
@description('An array of Network Diagnostic Logs to enable for the Hub Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#logs for valid settings.')
param hubVirtualNetworkDiagnosticsLogs array = []
@description('An array of Network Diagnostic Metrics to enable for the Hub Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param hubVirtualNetworkDiagnosticsMetrics array = []
@description('An array of Network Security Group Rules to apply to the Hub Virtual Network. See https://docs.microsoft.com/en-us/azure/templates/microsoft.network/networksecuritygroups/securityrules?tabs=bicep#securityrulepropertiesformat for valid settings.')
param hubNetworkSecurityGroupRules array = []
@description('An array of Network Security Group diagnostic logs to apply to the Hub Virtual Network. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-nsg-manage-log#log-categories for valid settings.')
param hubNetworkSecurityGroupDiagnosticsLogs array = [
{
category: 'NetworkSecurityGroupEvent'
enabled: true
}
{
category: 'NetworkSecurityGroupRuleCounter'
enabled: true
}
]
@description('An array of Network Security Group Metrics to apply to enable for the Hub Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param hubNetworkSecurityGroupDiagnosticsMetrics array = []
@description('An array of Service Endpoints to enable for the Hub subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param hubSubnetServiceEndpoints array = [
{
service: 'Microsoft.Storage'
}
]
// IDENTITY PARAMETERS
@description('An array of Network Diagnostic Logs to enable for the Identity Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#logs for valid settings.')
param identityVirtualNetworkDiagnosticsLogs array = []
@description('An array of Network Diagnostic Metrics to enable for the Identity Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param identityVirtualNetworkDiagnosticsMetrics array = []
@description('An array of Network Security Group Rules to apply to the Identity Virtual Network. See https://docs.microsoft.com/en-us/azure/templates/microsoft.network/networksecuritygroups/securityrules?tabs=bicep#securityrulepropertiesformat for valid settings.')
param identityNetworkSecurityGroupRules array = [
{
name: 'Allow-Traffic-From-Spokes'
properties: {
access: 'Allow'
description: 'Allow traffic from spokes'
destinationAddressPrefix: identityVirtualNetworkAddressPrefix
destinationPortRanges: [
'22'
'80'
'443'
'3389'
]
direction: 'Inbound'
priority: 200
protocol: '*'
sourceAddressPrefixes: [
operationsVirtualNetworkAddressPrefix
sharedServicesVirtualNetworkAddressPrefix
onPremVirtualNetworkAddressPrefix
t3VirtualNetworkAddressPrefix
]
sourcePortRange: '*'
}
type: 'string'
}
]
@description('An array of Network Security Group diagnostic logs to apply to the Identity Virtual Network. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-nsg-manage-log#log-categories for valid settings.')
param identityNetworkSecurityGroupDiagnosticsLogs array = [
{
category: 'NetworkSecurityGroupEvent'
enabled: true
}
{
category: 'NetworkSecurityGroupRuleCounter'
enabled: true
}
]
@description('An array of Network Security Group Metrics to apply to enable for the Identity Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param identityNetworkSecurityGroupDiagnosticsMetrics array = []
@description('An array of Service Endpoints to enable for the Identity subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param identitySubnetServiceEndpoints array = [
{
service: 'Microsoft.Storage'
}
]
// OPERATIONS PARAMETERS
@description('An array of Network Diagnostic Logs to enable for the Operations Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#logs for valid settings.')
param operationsVirtualNetworkDiagnosticsLogs array = []
@description('An array of Network Diagnostic Metrics to enable for the Operations Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param operationsVirtualNetworkDiagnosticsMetrics array = []
@description('An array of Network Security Group rules to apply to the Operations Virtual Network. See https://docs.microsoft.com/en-us/azure/templates/microsoft.network/networksecuritygroups/securityrules?tabs=bicep#securityrulepropertiesformat for valid settings.')
param operationsNetworkSecurityGroupRules array = [
{
name: 'Allow-Traffic-From-Spokes'
properties: {
access: 'Allow'
description: 'Allow traffic from spokes'
destinationAddressPrefix: operationsVirtualNetworkAddressPrefix
destinationPortRanges: [
'22'
'80'
'443'
'3389'
]
direction: 'Inbound'
priority: 200
protocol: '*'
sourceAddressPrefixes: [
identityVirtualNetworkAddressPrefix
sharedServicesVirtualNetworkAddressPrefix
onPremVirtualNetworkAddressPrefix
]
sourcePortRange: '*'
}
type: 'string'
}
]
@description('An array of Network Security Group diagnostic logs to apply to the Operations Virtual Network. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-nsg-manage-log#log-categories for valid settings.')
param operationsNetworkSecurityGroupDiagnosticsLogs array = [
{
category: 'NetworkSecurityGroupEvent'
enabled: true
}
{
category: 'NetworkSecurityGroupRuleCounter'
enabled: true
}
]
@description('An array of Network Security Group Diagnostic Metrics to enable for the Operations Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param operationsNetworkSecurityGroupDiagnosticsMetrics array = []
@description('An array of Service Endpoints to enable for the Operations subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param operationsSubnetServiceEndpoints array = [
{
service: 'Microsoft.Storage'
}
]
// SHARED SERVICES PARAMETERS
@description('An array of Network Diagnostic Logs to enable for the SharedServices Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#logs for valid settings.')
param sharedServicesVirtualNetworkDiagnosticsLogs array = []
@description('An array of Network Diagnostic Metrics to enable for the SharedServices Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param sharedServicesVirtualNetworkDiagnosticsMetrics array = []
@description('An array of Network Security Group rules to apply to the SharedServices Virtual Network. See https://docs.microsoft.com/en-us/azure/templates/microsoft.network/networksecuritygroups/securityrules?tabs=bicep#securityrulepropertiesformat for valid settings.')
param sharedServicesNetworkSecurityGroupRules array = [
{
name: 'Allow-Traffic-From-Spokes'
properties: {
access: 'Allow'
description: 'Allow traffic from spokes'
destinationAddressPrefix: sharedServicesVirtualNetworkAddressPrefix
destinationPortRanges: [
'22'
'80'
'443'
'3389'
]
direction: 'Inbound'
priority: 200
protocol: '*'
sourceAddressPrefixes: [
operationsVirtualNetworkAddressPrefix
identityVirtualNetworkAddressPrefix
t3VirtualNetworkAddressPrefix
]
sourcePortRange: '*'
}
type: 'string'
}
]
@description('An array of Network Security Group diagnostic logs to apply to the SharedServices Virtual Network. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-nsg-manage-log#log-categories for valid settings.')
param sharedServicesNetworkSecurityGroupDiagnosticsLogs array = [
{
category: 'NetworkSecurityGroupEvent'
enabled: true
}
{
category: 'NetworkSecurityGroupRuleCounter'
enabled: true
}
]
@description('An array of Network Security Group Diagnostic Metrics to enable for the SharedServices Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param sharedServicesNetworkSecurityGroupDiagnosticsMetrics array = []
@description('An array of Service Endpoints to enable for the SharedServices subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param sharedServicesSubnetServiceEndpoints array = [
{
service: 'Microsoft.Storage'
}
]
// On-PREM PARAMETERS
@description('An array of Network Diagnostic Logs to enable for the On-Prem Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#logs for valid settings.')
param onPremVirtualNetworkDiagnosticsLogs array = []
@description('An array of Network Diagnostic Metrics to enable for the On-Prem Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param onPremVirtualNetworkDiagnosticsMetrics array = []
@description('An array of Network Security Group rules to apply to the On-Prem Virtual Network. See https://docs.microsoft.com/en-us/azure/templates/microsoft.network/networksecuritygroups/securityrules?tabs=bicep#securityrulepropertiesformat for valid settings.')
param onPremNetworkSecurityGroupRules array = [
{
name: 'Allow-Traffic-From-Spokes'
properties: {
access: 'Allow'
description: 'Allow traffic from spokes'
destinationAddressPrefix: onPremVirtualNetworkAddressPrefix
destinationPortRanges: [
'22'
'80'
'443'
'3389'
]
direction: 'Inbound'
priority: 200
protocol: '*'
sourceAddressPrefixes: [
operationsVirtualNetworkAddressPrefix
identityVirtualNetworkAddressPrefix
sharedServicesVirtualNetworkAddressPrefix
]
sourcePortRange: '*'
}
type: 'string'
}
]
@description('An array of Network Security Group diagnostic logs to apply to the On-Prem Virtual Network. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-nsg-manage-log#log-categories for valid settings.')
param onPremNetworkSecurityGroupDiagnosticsLogs array = [
{
category: 'NetworkSecurityGroupEvent'
enabled: true
}
{
category: 'NetworkSecurityGroupRuleCounter'
enabled: true
}
]
@description('An array of Network Security Group Diagnostic Metrics to enable for the On-Prem Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param onPremNetworkSecurityGroupDiagnosticsMetrics array = []
@description('An array of Service Endpoints to enable for the On-Prem subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param onPremSubnetServiceEndpoints array = [
{
service: 'Microsoft.Storage'
}
]
// Tier3 PARAMETERS
@description('An array of Network Diagnostic Logs to enable for the T3 Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#logs for valid settings.')
param t3VirtualNetworkDiagnosticsLogs array = []
@description('An array of Network Diagnostic Metrics to enable for the T3 Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param t3VirtualNetworkDiagnosticsMetrics array = []
@description('An array of Network Security Group rules to apply to the T3 Virtual Network. See https://docs.microsoft.com/en-us/azure/templates/microsoft.network/networksecuritygroups/securityrules?tabs=bicep#securityrulepropertiesformat for valid settings.')
param t3NetworkSecurityGroupRules array = [
{
name: 'Allow-Traffic-From-Spokes'
properties: {
access: 'Allow'
description: 'Allow traffic from spokes'
destinationAddressPrefix: t3VirtualNetworkAddressPrefix
destinationPortRanges: [
'22'
'80'
'443'
'3389'
]
direction: 'Inbound'
priority: 200
protocol: '*'
sourceAddressPrefixes: [
operationsVirtualNetworkAddressPrefix
identityVirtualNetworkAddressPrefix
sharedServicesVirtualNetworkAddressPrefix
]
sourcePortRange: '*'
}
type: 'string'
}
]
@description('An array of Network Security Group diagnostic logs to apply to the T3 Virtual Network. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-nsg-manage-log#log-categories for valid settings.')
param t3NetworkSecurityGroupDiagnosticsLogs array = [
{
category: 'NetworkSecurityGroupEvent'
enabled: true
}
{
category: 'NetworkSecurityGroupRuleCounter'
enabled: true
}
]
@description('An array of Network Security Group Diagnostic Metrics to enable for the T3 Virtual Network. See https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=CMD#metrics for valid settings.')
param t3NetworkSecurityGroupDiagnosticsMetrics array = []
@description('An array of Service Endpoints to enable for the T3 subnet. See https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview for valid settings.')
param t3SubnetServiceEndpoints array = [
{
service: 'Microsoft.Storage'
}
]
// LOGGING PARAMETERS
@description('When set to "true", enables Microsoft Sentinel within the Log Analytics Workspace created in this deployment. It defaults to "false".')
param deploySentinel bool = false
@description('The daily quota for Log Analytics Workspace logs in Gigabytes. It defaults to "-1" for no quota.')
param logAnalyticsWorkspaceCappingDailyQuotaGb int = -1
@description('The number of days to retain Log Analytics Workspace logs. It defaults to "30".')
param logAnalyticsWorkspaceRetentionInDays int = 30
@allowed([
'Free'
'Standard'
'Premium'
'PerNode'
'PerGB2018'
'Standalone'
])
@description('[Free/Standard/Premium/PerNode/PerGB2018/Standalone] The SKU for the Log Analytics Workspace. It defaults to "PerGB2018". See https://docs.microsoft.com/en-us/azure/azure-monitor/logs/resource-manager-workspace for valid settings.')
param logAnalyticsWorkspaceSkuName string = 'PerGB2018'
@description('The Storage Account SKU to use for log storage. It defaults to "Standard_GRS". See https://docs.microsoft.com/en-us/rest/api/storagerp/srp_sku_types for valid settings.')
param logStorageSkuName string = 'Standard_GRS'
// REMOTE ACCESS PARAMETERS
@description('When set to "true", provisions Azure Bastion Host and virtual machine jumpboxes. It defaults to "false".')
param deployRemoteAccess bool = false
@description('The CIDR Subnet Address Prefix for the Azure Bastion Subnet. It must be in the Hub Virtual Network space "hubVirtualNetworkAddressPrefix" parameter value. It must be /27 or larger.')
param bastionHostSubnetAddressPrefix string = '10.0.100.160/27'
@description('The Azure Bastion Public IP Address Availability Zones. It defaults to "No-Zone" because Availability Zones are not available in every cloud. See https://docs.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses#sku for valid settings.')
param bastionHostPublicIPAddressAvailabilityZones array = []
// POLICY PARAMETERS
@description('When set to "true", deploys the Azure Policy set defined at by the parameter "policy" to the resource groups generated in the deployment. It defaults to "false".')
param deployPolicy bool = false
@allowed([
'NIST'
'IL5' // AzureUsGoverment only, trying to deploy IL5 in AzureCloud will switch to NIST
'CMMC'
])
@description('[NIST/IL5/CMMC] Built-in policy assignments to assign, it defaults to "NIST". IL5 is only available for AzureUsGovernment and will switch to NIST if tried in AzureCloud.')
param policy string = 'NIST'
// MICROSOFT DEFENDER PARAMETERS
@description('When set to "true", enables Microsoft Defender for Cloud for the subscriptions used in the deployment. It defaults to "false".')
param deployDefender bool = false
@description('Email address of the contact, in the form of john@doe.com')
param emailSecurityContact string = ''
/*
NAMING CONVENTION
Here we define a naming conventions for resources.
First, we take `resourcePrefix` and `resourceSuffix` by params.
Then, using string interpolation "${}", we insert those values into a naming convention.
*/
var resourceToken = 'resource_token'
var nameToken = 'name_token'
var namingConvention = '${toLower(resourcePrefix)}-${resourceToken}-${nameToken}-${toLower(resourceSuffix)}'
/*
CALCULATED VALUES
Here we reference the naming conventions described above,
then use the "replace()" function to insert unique resource abbreviations and name values into the naming convention.
`storageAccountNamingConvention` is a unique naming convention:
In an effort to reduce the likelihood of naming collisions,
we replace `unique_storage_token` with a uniqueString() calculated by resourcePrefix, resourceSuffix, and the subscription ID
*/
// RESOURCE NAME CONVENTIONS WITH ABBREVIATIONS
var bastionHostNamingConvention = replace(namingConvention, resourceToken, 'bas')
var firewallNamingConvention = replace(namingConvention, resourceToken, 'afw')
var firewallPolicyNamingConvention = replace(namingConvention, resourceToken, 'afwp')
var ipConfigurationNamingConvention = replace(namingConvention, resourceToken, 'ipconf')
var logAnalyticsWorkspaceNamingConvention = replace(namingConvention, resourceToken, 'log')
var networkSecurityGroupNamingConvention = replace(namingConvention, resourceToken, 'nsg')
var publicIpAddressNamingConvention = replace(namingConvention, resourceToken, 'pip')
var resourceGroupNamingConvention = replace(namingConvention, resourceToken, 'rg')
var storageAccountNamingConvention = toLower('${resourcePrefix}st${nameToken}unique_storage_token')
var subnetNamingConvention = replace(namingConvention, resourceToken, 'snet')
var virtualNetworkNamingConvention = replace(namingConvention, resourceToken, 'vnet')
// HUB NAMES
var hubName = 'hub'
var hubShortName = 'hub'
var hubResourceGroupName = replace(resourceGroupNamingConvention, nameToken, hubName)
var hubLogStorageAccountShortName = replace(storageAccountNamingConvention, nameToken, hubShortName)
var hubLogStorageAccountUniqueName = replace(hubLogStorageAccountShortName, 'unique_storage_token', uniqueString(resourcePrefix, resourceSuffix, hubSubscriptionId))
var hubLogStorageAccountName = take(hubLogStorageAccountUniqueName, 23)
var hubVirtualNetworkName = replace(virtualNetworkNamingConvention, nameToken, hubName)
var hubNetworkSecurityGroupName = replace(networkSecurityGroupNamingConvention, nameToken, hubName)
var hubSubnetName = replace(subnetNamingConvention, nameToken, hubName)
// IDENTITY NAMES
var identityName = 'identity'
var identityShortName = 'id'
var identityResourceGroupName = replace(resourceGroupNamingConvention, nameToken, identityName)
var identityLogStorageAccountShortName = replace(storageAccountNamingConvention, nameToken, identityShortName)
var identityLogStorageAccountUniqueName = replace(identityLogStorageAccountShortName, 'unique_storage_token', uniqueString(resourcePrefix, resourceSuffix, identitySubscriptionId))
var identityLogStorageAccountName = take(identityLogStorageAccountUniqueName, 23)
var identityVirtualNetworkName = replace(virtualNetworkNamingConvention, nameToken, identityName)
var identityNetworkSecurityGroupName = replace(networkSecurityGroupNamingConvention, nameToken, identityName)
var identitySubnetName = replace(subnetNamingConvention, nameToken, identityName)
// OPERATIONS NAMES
var operationsName = 'operations'
var operationsShortName = 'ops'
var operationsResourceGroupName = replace(resourceGroupNamingConvention, nameToken, operationsName)
var operationsLogStorageAccountShortName = replace(storageAccountNamingConvention, nameToken, operationsShortName)
var operationsLogStorageAccountUniqueName = replace(operationsLogStorageAccountShortName, 'unique_storage_token', uniqueString(resourcePrefix, resourceSuffix, operationsSubscriptionId))
var operationsLogStorageAccountName = take(operationsLogStorageAccountUniqueName, 23)
var operationsVirtualNetworkName = replace(virtualNetworkNamingConvention, nameToken, operationsName)
var operationsNetworkSecurityGroupName = replace(networkSecurityGroupNamingConvention, nameToken, operationsName)
var operationsSubnetName = replace(subnetNamingConvention, nameToken, operationsName)
// SHARED SERVICES NAMES
var sharedServicesName = 'sharedServices'
var sharedServicesShortName = 'svcs'
var sharedServicesResourceGroupName = replace(resourceGroupNamingConvention, nameToken, sharedServicesName)
var sharedServicesLogStorageAccountShortName = replace(storageAccountNamingConvention, nameToken, sharedServicesShortName)
var sharedServicesLogStorageAccountUniqueName = replace(sharedServicesLogStorageAccountShortName, 'unique_storage_token', uniqueString(resourcePrefix, resourceSuffix, sharedServicesSubscriptionId))
var sharedServicesLogStorageAccountName = take(sharedServicesLogStorageAccountUniqueName, 23)
var sharedServicesVirtualNetworkName = replace(virtualNetworkNamingConvention, nameToken, sharedServicesName)
var sharedServicesNetworkSecurityGroupName = replace(networkSecurityGroupNamingConvention, nameToken, sharedServicesName)
var sharedServicesSubnetName = replace(subnetNamingConvention, nameToken, sharedServicesName)
// On-Prem NAMES
var onPremName = 'onPrem'
var onPremShortName = 'onprem'
var onPremResourceGroupName = replace(resourceGroupNamingConvention, nameToken, onPremName)
var onPremLogStorageAccountShortName = replace(storageAccountNamingConvention, nameToken, onPremShortName)
var onPremLogStorageAccountUniqueName = replace(onPremLogStorageAccountShortName, 'unique_storage_token', uniqueString(resourcePrefix, resourceSuffix, onPremSubscriptionId))
var onPremLogStorageAccountName = take(onPremLogStorageAccountUniqueName, 23)
var onPremVirtualNetworkName = replace(virtualNetworkNamingConvention, nameToken, onPremName)
var onPremNetworkSecurityGroupName = replace(networkSecurityGroupNamingConvention, nameToken, onPremName)
var onPremSubnetName = replace(subnetNamingConvention, nameToken, onPremName)
// T3 NAMES
var t3Name = 'tier3'
var t3ShortName = 't3'
var t3ResourceGroupName = replace(resourceGroupNamingConvention, nameToken, t3Name)
var t3LogStorageAccountShortName = replace(storageAccountNamingConvention, nameToken, t3ShortName)
var t3LogStorageAccountUniqueName = replace(t3LogStorageAccountShortName, 'unique_storage_token', uniqueString(resourcePrefix, resourceSuffix, t3SubscriptionId))
var t3LogStorageAccountName = take(t3LogStorageAccountUniqueName, 23)
var t3VirtualNetworkName = replace(virtualNetworkNamingConvention, nameToken, t3Name)
var t3NetworkSecurityGroupName = replace(networkSecurityGroupNamingConvention, nameToken, t3Name)
var t3SubnetName = replace(subnetNamingConvention, nameToken, t3Name)
// LOG ANALYTICS NAMES
var logAnalyticsWorkspaceName = replace(logAnalyticsWorkspaceNamingConvention, nameToken, operationsName)
// FIREWALL NAMES
var firewallName = replace(firewallNamingConvention, nameToken, hubName)
var firewallPolicyName = replace(firewallPolicyNamingConvention, nameToken, hubName)
var firewallClientIpConfigurationName = replace(ipConfigurationNamingConvention, nameToken, 'afw-client')
var firewallClientPublicIPAddressName = replace(publicIpAddressNamingConvention, nameToken, 'afw-client')
var firewallManagementIpConfigurationName = replace(ipConfigurationNamingConvention, nameToken, 'afw-mgmt')
var firewallManagementPublicIPAddressName = replace(publicIpAddressNamingConvention, nameToken, 'afw-mgmt')
// FIREWALL VALUES
var firewallPublicIpAddressSkuName = 'Standard'
var firewallPublicIpAddressAllocationMethod = 'Static'
// BASTION NAMES
var bastionHostName = replace(bastionHostNamingConvention, nameToken, hubName)
var bastionHostPublicIPAddressName = replace(publicIpAddressNamingConvention, nameToken, 'bas')
var bastionHostIPConfigurationName = replace(ipConfigurationNamingConvention, nameToken, 'bas')
// BASTION VALUES
var bastionHostPublicIPAddressSkuName = 'Standard'
var bastionHostPublicIPAddressAllocationMethod = 'Static'
// SPOKES
var spokes = [
{
name: identityName
subscriptionId: identitySubscriptionId
resourceGroupName: identityResourceGroupName
logStorageAccountName: identityLogStorageAccountName
virtualNetworkName: identityVirtualNetworkName
virtualNetworkAddressPrefix: identityVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: identityVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: identityVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: identityNetworkSecurityGroupName
networkSecurityGroupRules: identityNetworkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: identityNetworkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: identityNetworkSecurityGroupDiagnosticsMetrics
subnetName: identitySubnetName
subnetAddressPrefix: identitySubnetAddressPrefix
subnetServiceEndpoints: identitySubnetServiceEndpoints
}
{
name: operationsName
subscriptionId: operationsSubscriptionId
resourceGroupName: operationsResourceGroupName
logStorageAccountName: operationsLogStorageAccountName
virtualNetworkName: operationsVirtualNetworkName
virtualNetworkAddressPrefix: operationsVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: operationsVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: operationsVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: operationsNetworkSecurityGroupName
networkSecurityGroupRules: operationsNetworkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: operationsNetworkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: operationsNetworkSecurityGroupDiagnosticsMetrics
subnetName: operationsSubnetName
subnetAddressPrefix: operationsSubnetAddressPrefix
subnetServiceEndpoints: operationsSubnetServiceEndpoints
}
{
name: sharedServicesName
subscriptionId: sharedServicesSubscriptionId
resourceGroupName: sharedServicesResourceGroupName
logStorageAccountName: sharedServicesLogStorageAccountName
virtualNetworkName: sharedServicesVirtualNetworkName
virtualNetworkAddressPrefix: sharedServicesVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: sharedServicesVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: sharedServicesVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: sharedServicesNetworkSecurityGroupName
networkSecurityGroupRules: sharedServicesNetworkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: sharedServicesNetworkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: sharedServicesNetworkSecurityGroupDiagnosticsMetrics
subnetName: sharedServicesSubnetName
subnetAddressPrefix: sharedServicesSubnetAddressPrefix
subnetServiceEndpoints: sharedServicesSubnetServiceEndpoints
}
{
name: onPremName
subscriptionId: onPremSubscriptionId
resourceGroupName: onPremResourceGroupName
logStorageAccountName: onPremLogStorageAccountName
virtualNetworkName: onPremVirtualNetworkName
virtualNetworkAddressPrefix: onPremVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: onPremVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: onPremVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: onPremNetworkSecurityGroupName
networkSecurityGroupRules: onPremNetworkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: onPremNetworkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: onPremNetworkSecurityGroupDiagnosticsMetrics
subnetName: onPremSubnetName
subnetAddressPrefix: onPremSubnetAddressPrefix
subnetServiceEndpoints: onPremSubnetServiceEndpoints
}
{
name: t3Name
subscriptionId: t3SubscriptionId
resourceGroupName: t3ResourceGroupName
logStorageAccountName: t3LogStorageAccountName
virtualNetworkName: t3VirtualNetworkName
virtualNetworkAddressPrefix: t3VirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: t3VirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: t3VirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: t3NetworkSecurityGroupName
networkSecurityGroupRules: t3NetworkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: t3NetworkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: t3NetworkSecurityGroupDiagnosticsMetrics
subnetName: t3SubnetName
subnetAddressPrefix: t3SubnetAddressPrefix
subnetServiceEndpoints: t3SubnetServiceEndpoints
}
]
// TAGS
var defaultTags = {
'resourcePrefix': resourcePrefix
'resourceSuffix': resourceSuffix
'DeploymentType': 'MissionLandingZoneARM'
}
var calculatedTags = union(tags, defaultTags)
/*
RESOURCES
Here we create deployable resources.
*/
// RESOURCE GROUPS
module hubResourceGroup './modules/resource-group.bicep' = {
name: 'deploy-rg-hub-${deploymentNameSuffix}'
scope: subscription(hubSubscriptionId)
params: {
name: hubResourceGroupName
location: location
tags: calculatedTags
}
}
module spokeResourceGroups './modules/resource-group.bicep' = [for spoke in spokes: {
name: 'deploy-rg-${spoke.name}-${deploymentNameSuffix}'
scope: subscription(spoke.subscriptionId)
params: {
name: spoke.resourceGroupName
location: location
tags: calculatedTags
}
}]
// LOG ANALYTICS WORKSPACE
module logAnalyticsWorkspace './modules/log-analytics-workspace.bicep' = {
name: 'deploy-laws-${deploymentNameSuffix}'
scope: resourceGroup(operationsSubscriptionId, operationsResourceGroupName)
params: {
name: logAnalyticsWorkspaceName
location: location
tags: calculatedTags
deploySentinel: deploySentinel
retentionInDays: logAnalyticsWorkspaceRetentionInDays
skuName: logAnalyticsWorkspaceSkuName
workspaceCappingDailyQuotaGb: logAnalyticsWorkspaceCappingDailyQuotaGb
}
dependsOn: [
spokeResourceGroups
]
}
// HUB AND SPOKE NETWORKS
module hubNetwork './core/hub-network.bicep' = {
name: 'deploy-vnet-hub-${deploymentNameSuffix}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
params: {
location: location
tags: calculatedTags
logStorageAccountName: hubLogStorageAccountName
logStorageSkuName: logStorageSkuName
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspace.outputs.id
virtualNetworkName: hubVirtualNetworkName
virtualNetworkAddressPrefix: hubVirtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: hubVirtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: hubVirtualNetworkDiagnosticsMetrics
networkSecurityGroupName: hubNetworkSecurityGroupName
networkSecurityGroupRules: hubNetworkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: hubNetworkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: hubNetworkSecurityGroupDiagnosticsMetrics
subnetName: hubSubnetName
subnetAddressPrefix: hubSubnetAddressPrefix
subnetServiceEndpoints: hubSubnetServiceEndpoints
firewallName: firewallName
firewallSkuTier: firewallSkuTier
firewallPolicyName: firewallPolicyName
firewallThreatIntelMode: firewallThreatIntelMode
firewallDiagnosticsLogs: firewallDiagnosticsLogs
firewallDiagnosticsMetrics: firewallDiagnosticsMetrics
firewallClientIpConfigurationName: firewallClientIpConfigurationName
firewallClientSubnetName: 'AzureFirewallSubnet' // this must be 'AzureFirewallSubnet'
firewallClientSubnetAddressPrefix: firewallClientSubnetAddressPrefix
firewallClientSubnetServiceEndpoints: firewallClientSubnetServiceEndpoints
firewallClientPublicIPAddressName: firewallClientPublicIPAddressName
firewallClientPublicIPAddressSkuName: firewallPublicIpAddressSkuName
firewallClientPublicIpAllocationMethod: firewallPublicIpAddressAllocationMethod
firewallClientPublicIPAddressAvailabilityZones: firewallClientPublicIPAddressAvailabilityZones
firewallManagementIpConfigurationName: firewallManagementIpConfigurationName
firewallManagementSubnetName: 'AzureFirewallManagementSubnet' // this must be 'AzureFirewallManagementSubnet'
firewallManagementSubnetAddressPrefix: firewallManagementSubnetAddressPrefix
firewallManagementSubnetServiceEndpoints: firewallManagementSubnetServiceEndpoints
firewallManagementPublicIPAddressName: firewallManagementPublicIPAddressName
firewallManagementPublicIPAddressSkuName: firewallPublicIpAddressSkuName
firewallManagementPublicIpAllocationMethod: firewallPublicIpAddressAllocationMethod
firewallManagementPublicIPAddressAvailabilityZones: firewallManagementPublicIPAddressAvailabilityZones
firewallSupernetIPAddress: firewallSupernetIPAddress
publicIPAddressDiagnosticsLogs: publicIPAddressDiagnosticsLogs
publicIPAddressDiagnosticsMetrics: publicIPAddressDiagnosticsMetrics
}
}
module spokeNetworks './core/spoke-network.bicep' = [for spoke in spokes: {
name: 'deploy-vnet-${spoke.name}-${deploymentNameSuffix}'
scope: resourceGroup(spoke.subscriptionId, spoke.resourceGroupName)
params: {
location: location
tags: calculatedTags
logStorageAccountName: spoke.logStorageAccountName
logStorageSkuName: logStorageSkuName
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspace.outputs.id
firewallPrivateIPAddress: hubNetwork.outputs.firewallPrivateIPAddress
virtualNetworkName: spoke.virtualNetworkName
virtualNetworkAddressPrefix: spoke.virtualNetworkAddressPrefix
virtualNetworkDiagnosticsLogs: spoke.virtualNetworkDiagnosticsLogs
virtualNetworkDiagnosticsMetrics: spoke.virtualNetworkDiagnosticsMetrics
networkSecurityGroupName: spoke.networkSecurityGroupName
networkSecurityGroupRules: spoke.networkSecurityGroupRules
networkSecurityGroupDiagnosticsLogs: spoke.networkSecurityGroupDiagnosticsLogs
networkSecurityGroupDiagnosticsMetrics: spoke.networkSecurityGroupDiagnosticsMetrics
subnetName: spoke.subnetName
subnetAddressPrefix: spoke.subnetAddressPrefix
subnetServiceEndpoints: spoke.subnetServiceEndpoints
}
}]
// VIRTUAL NETWORK PEERINGS
module hubVirtualNetworkPeerings './core/hub-network-peerings.bicep' = {
name: 'deploy-vnet-peerings-hub-${deploymentNameSuffix}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
params: {
hubVirtualNetworkName: hubNetwork.outputs.virtualNetworkName
spokes: [for (spoke, i) in spokes: {
type: spoke.name
virtualNetworkName: spokeNetworks[i].outputs.virtualNetworkName
virtualNetworkResourceId: spokeNetworks[i].outputs.virtualNetworkResourceId
}]
}
}
module spokeVirtualNetworkPeerings './core/spoke-network-peering.bicep' = [for (spoke, i) in spokes: {
name: 'deploy-vnet-peerings-${spoke.name}-${deploymentNameSuffix}'
scope: subscription(spoke.subscriptionId)
params: {
spokeName: spoke.name
spokeResourceGroupName: spoke.resourceGroupName
spokeVirtualNetworkName: spokeNetworks[i].outputs.virtualNetworkName
hubVirtualNetworkName: hubNetwork.outputs.virtualNetworkName
hubVirtualNetworkResourceId: hubNetwork.outputs.virtualNetworkResourceId
}
}]
// POLICY ASSIGNMENTS
module hubPolicyAssignment './modules/policy-assignment.bicep' = if (deployPolicy) {
name: 'assign-policy-hub-${deploymentNameSuffix}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroupName)
params: {
builtInAssignment: policy
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceGroupName: logAnalyticsWorkspace.outputs.resourceGroupName
operationsSubscriptionId: operationsSubscriptionId
location: location
}
}
module spokePolicyAssignments './modules/policy-assignment.bicep' = [for spoke in spokes: if (deployPolicy) {
name: 'assign-policy-${spoke.name}-${deploymentNameSuffix}'
scope: resourceGroup(spoke.subscriptionId, spoke.resourceGroupName)
params: {
builtInAssignment: policy
logAnalyticsWorkspaceName: logAnalyticsWorkspace.outputs.name
logAnalyticsWorkspaceResourceGroupName: logAnalyticsWorkspace.outputs.resourceGroupName
operationsSubscriptionId: operationsSubscriptionId
location: location
}
}]
// CENTRAL LOGGING