-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
765 lines (762 loc) · 29.8 KB
/
variables.tf
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
variable "cdn_profile" {
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "cdn_endpoint" {
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "cdn_endpoint_custom_domain" {
type = any
default = {}
description = "resource definition, default settings are defined within locals and merged with var settings"
}
variable "cdn_frontdoor_profile" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_origin_group" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_origin" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_endpoint" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_custom_domain" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_route" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_rule_set" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_rule" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_secret" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_firewall_policy" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
variable "cdn_frontdoor_security_policy" {
type = any
default = {}
description = "Resource definition, default settings are defined within locals and merged with var settings. For more information look at [Outputs](#Outputs)."
}
locals {
default = {
// resource definition
cdn_profile = {
name = ""
tags = {}
}
cdn_endpoint = {
name = ""
is_http_allowed = null
is_https_allowed = null
content_types_to_compress = null
is_compression_enabled = null
querystring_caching_behaviour = null
optimization_type = null
origin_host_header = null
origin_path = null
probe_path = null
origin = {
name = ""
http_port = null
https_port = null
}
geo_filter = {
action = "Block" // define default
}
delivery_rule = {
name = ""
cache_expiration_action = {
duration = null
}
cache_key_query_string_action = {
parameters = null
}
cookies_condition = {
negate_condition = null
match_values = null
transforms = null
}
device_condition = {
operator = null
negate_condition = null
}
http_version_condition = {
operator = null
negate_condition = null
}
modify_request_header_action = {
value = null
}
modify_response_header_action = {
value = null
}
post_arg_condition = {
negate_condition = null
match_values = null
transforms = null
}
query_string_condition = {
negate_condition = null
match_values = null
transforms = null
}
remote_address_condition = {
negate_condition = null
match_values = null
}
request_body_condition = {
negate_condition = null
match_values = null
transforms = null
}
request_header_condition = {
negate_condition = null
match_values = null
transforms = null
}
request_method_condition = {
negate_condition = null
match_values = null
}
request_scheme_condition = {
negate_condition = null
match_values = null
}
request_uri_condition = {
negate_condition = null
match_values = null
transforms = null
}
url_file_extension_condition = {
negate_condition = null
match_values = null
transforms = null
}
url_file_name_condition = {
negate_condition = null
match_values = null
transforms = null
}
url_path_condition = {
negate_condition = null
match_values = null
transforms = null
}
url_redirect_action = {
protocol = null
hostname = null
path = null
fragment = null
query_string = null
}
url_rewrite_action = {
preserve_unmatched_path = null
}
}
global_delivery_rule = {
cache_expiration_action = {
duration = null
}
cache_key_query_string_action = {
parameters = null
}
modify_request_header_action = {
name = ""
value = null
}
modify_response_header_action = {
name = ""
value = null
}
url_redirect_action = {
protocol = null
hostname = null
path = null
fragment = null
query_string = null
}
url_rewrite_action = {
preserve_unmatched_path = null
}
}
tags = {}
}
cdn_endpoint_custom_domain = {
name = ""
cdn_managed_https = {
tls_version = null
}
user_managed_https = {
key_vault_certificate_id = null
key_vault_secret_id = null
tls_version = null
}
}
cdn_frontdoor_profile = {
name = ""
sku_name = "Standard_AzureFrontDoor"
response_timeout_seconds = null
tags = {}
}
cdn_frontdoor_origin_group = {
name = ""
restore_traffic_time_to_healed_or_new_endpoint_in_minutes = null
session_affinity_enabled = null
load_balancing = {
additional_latency_in_milliseconds = null
sample_size = null
successful_samples_required = null
}
health_probe = {
request_type = null
path = null
}
}
cdn_frontdoor_origin = {
name = ""
certificate_name_check_enabled = true // define default
enabled = true // created origin should be enabled by default
http_port = null
https_port = null
origin_host_header = null
priority = null
weight = null
private_link = {
request_message = null
target_type = null
}
}
cdn_frontdoor_endpoint = {
name = ""
enabled = null
tags = {}
}
cdn_frontdoor_custom_domain = {
name = ""
dns_zone_id = null
tls = {
certificate_type = null
minimum_tls_version = null
cdn_frontdoor_secret_id = null
}
}
cdn_frontdoor_route = {
name = ""
forwarding_protocol = null
patterns_to_match = ["/*"] // define default
supported_protocols = ["Http", "Https"] // define default match all
cdn_frontdoor_custom_domain_ids = null
cdn_frontdoor_origin_path = null
cdn_frontdoor_rule_set_ids = null
enabled = null
https_redirect_enabled = null
link_to_default_domain = false // disable link to default domain
cache = {
query_string_caching_behavior = null
query_strings = null
compression_enabled = null
content_types_to_compress = null
}
}
cdn_frontdoor_rule_set = {
name = ""
}
cdn_frontdoor_rule = {
name = ""
behavior_on_match = "Stop" // defined default
actions = {
url_rewrite_action = {
preserve_unmatched_path = null
}
url_redirect_action = {
redirect_type = "Found" // defined default
redirect_protocol = "Https" // defined default
destination_path = null
query_string = null
destination_fragment = null
}
route_configuration_override_action = {
cache_duration = null
cdn_frontdoor_origin_group_id = null
forwarding_protocol = null
query_string_caching_behavior = null
query_string_parameters = null
compression_enabled = null
cache_behavior = null
}
request_header_action = {
value = null
}
response_header_action = {
value = null
}
}
conditions = {
remote_address_condition = {
operator = null
negate_condition = null
match_values = null
}
request_method_condition = {
operator = null
negate_condition = null
}
query_string_condition = {
operator = null
negate_condition = null
match_values = null
transforms = null
}
post_args_condition = {
negate_condition = null
match_values = null
transforms = null
}
request_uri_condition = {
negate_condition = null
match_values = null
transforms = null
}
request_header_condition = {
negate_condition = null
match_values = null
transforms = null
}
request_body_condition = {
negate_condition = null
match_values = null
transforms = null
}
request_scheme_condition = {
operator = null
negate_condition = null
match_values = null
}
url_path_condition = {
negate_condition = null
match_values = null
transforms = null
}
url_file_extension_condition = {
negate_condition = null
match_values = null
transforms = null
}
url_filename_condition = {
negate_condition = null
match_values = null
transforms = null
}
http_version_condition = {
operator = null
negate_condition = null
}
cookies_condition = {
negate_condition = null
match_values = null
transforms = null
}
is_device_condition = {
operator = null
negate_condition = null
match_values = null
}
socket_address_condition = {
operator = null
negate_condition = null
match_values = null
}
client_port_condition = {
negate_condition = null
match_values = null
}
server_port_condition = {
negate_condition = null
}
host_name_condition = {
negate_condition = null
match_values = null
transforms = null
}
ssl_protocol_condition = {
operator = null
negate_condition = null
}
}
}
cdn_frontdoor_secret = {
name = ""
}
cdn_frontdoor_firewall_policy = {
name = ""
enabled = null
mode = "Prevention" // define default
redirect_url = null
custom_block_response_status_code = null
custom_block_response_body = null
custom_rule = {
name = ""
action = "Block" // define default
enabled = null
priority = null
rate_limit_duration_in_minutes = null
rate_limit_threshold = null
match_condition = {
match_values = [] // define default
selector = null
negation_condition = null
transforms = null
}
}
managed_rule = {
action = "Block" // define default
exclusion = {}
override = {
exclusion = {}
rule = {
enabled = true // defined override should be enabled
exclusion = {}
}
}
}
tags = {}
}
cdn_frontdoor_security_policy = {
name = ""
security_policies = {
firewall = {
association = {
patterns_to_match = ["/*"]
domain = {}
}
}
}
}
}
// compare and merge custom and default values
cdn_endpoint_values = {
for cdn_endpoint in keys(var.cdn_endpoint) :
cdn_endpoint => merge(local.default.cdn_endpoint, var.cdn_endpoint[cdn_endpoint])
}
cdn_endpoint_custom_domain_values = {
for cdn_endpoint_custom_domain in keys(var.cdn_endpoint_custom_domain) :
cdn_endpoint_custom_domain => merge(local.default.cdn_endpoint_custom_domain, var.cdn_endpoint_custom_domain[cdn_endpoint_custom_domain])
}
cdn_frontdoor_origin_group_values = {
for cdn_frontdoor_origin_group in keys(var.cdn_frontdoor_origin_group) :
cdn_frontdoor_origin_group => merge(local.default.cdn_frontdoor_origin_group, var.cdn_frontdoor_origin_group[cdn_frontdoor_origin_group])
}
cdn_frontdoor_origin_values = {
for cdn_frontdoor_origin in keys(var.cdn_frontdoor_origin) :
cdn_frontdoor_origin => merge(local.default.cdn_frontdoor_origin, var.cdn_frontdoor_origin[cdn_frontdoor_origin])
}
cdn_frontdoor_custom_domain_values = {
for cdn_frontdoor_custom_domain in keys(var.cdn_frontdoor_custom_domain) :
cdn_frontdoor_custom_domain => merge(local.default.cdn_frontdoor_custom_domain, var.cdn_frontdoor_custom_domain[cdn_frontdoor_custom_domain])
}
cdn_frontdoor_route_values = {
for cdn_frontdoor_route in keys(var.cdn_frontdoor_route) :
cdn_frontdoor_route => merge(local.default.cdn_frontdoor_route, var.cdn_frontdoor_route[cdn_frontdoor_route])
}
cdn_frontdoor_rule_values = {
for cdn_frontdoor_rule in keys(var.cdn_frontdoor_rule) :
cdn_frontdoor_rule => merge(local.default.cdn_frontdoor_rule, var.cdn_frontdoor_rule[cdn_frontdoor_rule])
}
cdn_frontdoor_firewall_policy_values = {
for cdn_frontdoor_firewall_policy in keys(var.cdn_frontdoor_firewall_policy) :
cdn_frontdoor_firewall_policy => merge(local.default.cdn_frontdoor_firewall_policy, var.cdn_frontdoor_firewall_policy[cdn_frontdoor_firewall_policy])
}
cdn_frontdoor_security_policy_values = {
for cdn_frontdoor_security_policy in keys(var.cdn_frontdoor_security_policy) :
cdn_frontdoor_security_policy => merge(local.default.cdn_frontdoor_security_policy, var.cdn_frontdoor_security_policy[cdn_frontdoor_security_policy])
}
// deep merge of all custom and default values
cdn_profile = {
for cdn_profile in keys(var.cdn_profile) :
cdn_profile => merge(local.default.cdn_profile, var.cdn_profile[cdn_profile])
}
cdn_endpoint = {
for cdn_endpoint in keys(var.cdn_endpoint) :
cdn_endpoint => merge(
local.cdn_endpoint_values[cdn_endpoint],
{
for config in ["origin", "geo_filter"] :
config => keys(local.cdn_endpoint_values[cdn_endpoint][config]) == keys(local.default.cdn_endpoint[config]) ? {} : {
for key in keys(local.cdn_endpoint_values[cdn_endpoint][config]) :
key => merge(local.default.cdn_endpoint[config], local.cdn_endpoint_values[cdn_endpoint][config][key])
}
},
{
for config in ["delivery_rule"] :
config => keys(local.cdn_endpoint_values[cdn_endpoint][config]) == keys(local.default.cdn_endpoint[config]) ? {} : {
for key in keys(local.cdn_endpoint_values[cdn_endpoint][config]) :
key => merge(
merge(local.default.cdn_endpoint[config], local.cdn_endpoint_values[cdn_endpoint][config][key]),
{
for subconfig in [
"cache_expiration_action",
"cache_key_query_string_action",
"cookies_condition",
"device_condition",
"http_version_condition",
"modify_request_header_action",
"modify_response_header_action",
"post_arg_condition",
"query_string_condition",
"remote_address_condition",
"request_body_condition",
"request_header_condition",
"request_method_condition",
"request_scheme_condition",
"request_uri_condition",
"url_file_extension_condition",
"url_file_name_condition",
"url_path_condition",
"url_redirect_action",
"url_rewrite_action",
] :
subconfig => lookup(local.cdn_endpoint_values[cdn_endpoint][config][key], subconfig, {}) == {} ? null : merge(local.default.cdn_endpoint[config][subconfig], local.cdn_endpoint_values[cdn_endpoint][config][key][subconfig])
}
)
}
},
{
for config in ["global_delivery_rule"] :
config => lookup(var.cdn_endpoint[cdn_endpoint], config, {}) == {} ? null : {
for subconfig in [
"cache_expiration_action",
"cache_key_query_string_action",
"modify_request_header_action",
"modify_response_header_action",
"url_redirect_action",
"url_rewrite_action",
] :
subconfig => lookup(local.cdn_endpoint_values[cdn_endpoint][config], subconfig, {}) == {} ? null : merge(local.default.cdn_endpoint[config][subconfig], local.cdn_endpoint_values[cdn_endpoint][config][subconfig])
}
}
)
}
cdn_endpoint_custom_domain = {
for cdn_endpoint_custom_domain in keys(var.cdn_endpoint_custom_domain) :
cdn_endpoint_custom_domain => merge(
local.cdn_endpoint_custom_domain_values[cdn_endpoint_custom_domain],
{
for config in ["cdn_managed_https", "user_managed_https"] :
config => lookup(var.cdn_endpoint_custom_domain[cdn_endpoint_custom_domain], config, {}) == {} ? null : merge(local.default.cdn_endpoint_custom_domain[config], local.cdn_endpoint_custom_domain_values[cdn_endpoint_custom_domain][config])
}
)
}
cdn_frontdoor_profile = {
for cdn_frontdoor_profile in keys(var.cdn_frontdoor_profile) :
cdn_frontdoor_profile => merge(local.default.cdn_frontdoor_profile, var.cdn_frontdoor_profile[cdn_frontdoor_profile])
}
cdn_frontdoor_origin_group = {
for cdn_frontdoor_origin_group in keys(var.cdn_frontdoor_origin_group) :
cdn_frontdoor_origin_group => merge(
local.cdn_frontdoor_origin_group_values[cdn_frontdoor_origin_group],
{
for config in ["load_balancing", "health_probe"] :
config => merge(local.default.cdn_frontdoor_origin_group[config], local.cdn_frontdoor_origin_group_values[cdn_frontdoor_origin_group][config])
}
)
}
cdn_frontdoor_origin = {
for cdn_frontdoor_origin in keys(var.cdn_frontdoor_origin) :
cdn_frontdoor_origin => merge(
local.cdn_frontdoor_origin_values[cdn_frontdoor_origin],
{
for config in ["private_link"] :
config => merge(local.default.cdn_frontdoor_origin[config], local.cdn_frontdoor_origin_values[cdn_frontdoor_origin][config])
}
)
}
cdn_frontdoor_endpoint = {
for cdn_frontdoor_endpoint in keys(var.cdn_frontdoor_endpoint) :
cdn_frontdoor_endpoint => merge(local.default.cdn_frontdoor_endpoint, var.cdn_frontdoor_endpoint[cdn_frontdoor_endpoint])
}
cdn_frontdoor_custom_domain = {
for cdn_frontdoor_custom_domain in keys(var.cdn_frontdoor_custom_domain) :
cdn_frontdoor_custom_domain => merge(
local.cdn_frontdoor_custom_domain_values[cdn_frontdoor_custom_domain],
{
for config in ["tls"] :
config => merge(local.default.cdn_frontdoor_custom_domain[config], local.cdn_frontdoor_custom_domain_values[cdn_frontdoor_custom_domain][config])
}
)
}
cdn_frontdoor_route = {
for cdn_frontdoor_route in keys(var.cdn_frontdoor_route) :
cdn_frontdoor_route => merge(
local.cdn_frontdoor_route_values[cdn_frontdoor_route],
{
for config in ["cache"] :
config => merge(local.default.cdn_frontdoor_route[config], local.cdn_frontdoor_route_values[cdn_frontdoor_route][config])
}
)
}
cdn_frontdoor_rule_set = {
for cdn_frontdoor_rule_set in keys(var.cdn_frontdoor_rule_set) :
cdn_frontdoor_rule_set => merge(local.default.cdn_frontdoor_rule_set, var.cdn_frontdoor_rule_set[cdn_frontdoor_rule_set])
}
cdn_frontdoor_rule = {
for cdn_frontdoor_rule in keys(var.cdn_frontdoor_rule) :
cdn_frontdoor_rule => merge(
local.cdn_frontdoor_rule_values[cdn_frontdoor_rule],
{
for config in ["actions"] :
config => merge(
{
for subconfig in ["route_configuration_override_action"] :
subconfig => lookup(local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config], subconfig, {}) == {} ? null : merge(local.default.cdn_frontdoor_rule[config][subconfig], local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config][subconfig])
},
{
for subconfig in [
"url_rewrite_action",
"url_redirect_action",
"request_header_action",
"response_header_action"
] :
subconfig => lookup(local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config], subconfig, {}) == {} ? {} : {
for key in keys(local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config][subconfig]) :
key => merge(local.default.cdn_frontdoor_rule[config][subconfig], local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config][subconfig][key])
}
}
)
},
{
for config in ["conditions"] :
config => lookup(var.cdn_frontdoor_rule[cdn_frontdoor_rule], config, {}) == {} ? null : {
for subconfig in [
"remote_address_condition",
"request_method_condition",
"query_string_condition",
"post_args_condition",
"request_uri_condition",
"request_header_condition",
"request_body_condition",
"request_scheme_condition",
"url_path_condition",
"url_file_extension_condition",
"url_filename_condition",
"http_version_condition",
"cookies_condition",
"is_device_condition",
"socket_address_condition",
"client_port_condition",
"server_port_condition",
"host_name_condition",
"ssl_protocol_condition",
] :
subconfig => lookup(local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config], subconfig, {}) == {} ? {} : {
for key in keys(local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config][subconfig]) :
key => merge(local.default.cdn_frontdoor_rule[config][subconfig], local.cdn_frontdoor_rule_values[cdn_frontdoor_rule][config][subconfig][key])
}
}
}
)
}
cdn_frontdoor_secret = {
for cdn_frontdoor_secret in keys(var.cdn_frontdoor_secret) :
cdn_frontdoor_secret => merge(local.default.cdn_frontdoor_secret, var.cdn_frontdoor_secret[cdn_frontdoor_secret])
}
cdn_frontdoor_firewall_policy = {
for cdn_frontdoor_firewall_policy in keys(var.cdn_frontdoor_firewall_policy) :
cdn_frontdoor_firewall_policy => merge(
local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy],
{
for config in ["custom_rule"] :
config => keys(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config]) == keys(local.default.cdn_frontdoor_firewall_policy[config]) ? {} : {
for key in keys(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config]) :
key => merge(
merge(local.default.cdn_frontdoor_firewall_policy[config], local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key]),
{
for subconfig in ["match_condition"] :
subconfig => keys(lookup(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key], subconfig, {})) == keys(local.default.cdn_frontdoor_firewall_policy[config][subconfig]) ? {} : {
for subkey in keys(lookup(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key], subconfig, {})) :
subkey => merge(local.default.cdn_frontdoor_firewall_policy[config][subconfig], local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key][subconfig][subkey])
}
}
)
}
},
{
for config in ["managed_rule"] :
config => keys(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config]) == keys(local.default.cdn_frontdoor_firewall_policy[config]) ? {} : {
for key in keys(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config]) :
key => merge(
merge(local.default.cdn_frontdoor_firewall_policy[config], local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key]),
{
for subconfig in ["override"] :
subconfig => keys(lookup(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key], subconfig, {})) == keys(local.default.cdn_frontdoor_firewall_policy[config][subconfig]) ? {} : {
for subkey in keys(lookup(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key], subconfig, {})) :
subkey => merge(
merge(local.default.cdn_frontdoor_firewall_policy[config][subconfig], local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key][subconfig][subkey]),
{
for subsubconfig in ["rule"] :
subsubconfig => keys(lookup(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key][subconfig][subkey], subsubconfig, {})) == keys(local.default.cdn_frontdoor_firewall_policy[config][subconfig][subsubconfig]) ? {} : {
for subsubkey in keys(lookup(local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key][subconfig][subkey], subsubconfig, {})) :
subsubkey => merge(local.default.cdn_frontdoor_firewall_policy[config][subconfig][subsubconfig], local.cdn_frontdoor_firewall_policy_values[cdn_frontdoor_firewall_policy][config][key][subconfig][subkey][subsubconfig][subsubkey])
}
}
)
}
},
)
}
}
)
}
cdn_frontdoor_security_policy = {
for cdn_frontdoor_security_policy in keys(var.cdn_frontdoor_security_policy) :
cdn_frontdoor_security_policy => merge(
local.cdn_frontdoor_security_policy_values[cdn_frontdoor_security_policy],
{
for config in ["security_policies"] :
config => merge(
merge(local.default.cdn_frontdoor_security_policy[config], local.cdn_frontdoor_security_policy_values[cdn_frontdoor_security_policy][config]),
{
for subconfig in ["firewall"] :
subconfig => merge(
merge(local.default.cdn_frontdoor_security_policy[config][subconfig], local.cdn_frontdoor_security_policy_values[cdn_frontdoor_security_policy][config][subconfig]),
{
for subsubconfig in ["association"] :
subsubconfig => merge(local.default.cdn_frontdoor_security_policy[config][subconfig][subsubconfig], local.cdn_frontdoor_security_policy_values[cdn_frontdoor_security_policy][config][subconfig][subsubconfig])
}
)
}
)
}
)
}
}