forked from cloudposse/terraform-aws-waf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
47 lines (36 loc) · 1.27 KB
/
main.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
resource "aws_wafv2_web_acl_association" "default" {
count = module.this.enabled && length(var.association_resource_arns) > 0 ? length(var.association_resource_arns) : 0
resource_arn = var.association_resource_arns[count.index]
web_acl_arn = join("", aws_wafv2_web_acl.default.*.arn)
}
resource "aws_wafv2_web_acl_logging_configuration" "default" {
count = module.this.enabled && length(var.log_destination_configs) > 0 ? 1 : 0
log_destination_configs = var.log_destination_configs
resource_arn = join("", aws_wafv2_web_acl.default.*.arn)
dynamic "redacted_fields" {
for_each = var.redacted_fields
content {
dynamic "method" {
for_each = redacted_fields.value.method_enabled ? [1] : []
content {
}
}
dynamic "query_string" {
for_each = redacted_fields.value.query_string_enabled ? [1] : []
content {
}
}
dynamic "uri_path" {
for_each = redacted_fields.value.uri_path_enabled ? [1] : []
content {
}
}
dynamic "single_header" {
for_each = lookup(redacted_fields.value, "single_header", null) != null ? toset(redacted_fields.value.single_header) : []
content {
name = single_header.value
}
}
}
}
}