-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaf.tf
More file actions
41 lines (34 loc) · 819 Bytes
/
Copy pathwaf.tf
File metadata and controls
41 lines (34 loc) · 819 Bytes
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
resource "aws_wafv2_web_acl" "main" {
name = "main-web-acl"
scope = "REGIONAL"
default_action {
allow {}
}
rule {
name = "rule-1"
priority = 1
override_action {
count {}
}
statement {
managed_rule_group_statement {
name = "AWSManagedRulesCommonRuleSet"
vendor_name = "AWS"
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "rule-1-metric"
sampled_requests_enabled = true
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "main-web-acl-metric"
sampled_requests_enabled = true
}
}
resource "aws_wafv2_web_acl_association" "main" {
resource_arn = aws_lb.web.arn
web_acl_arn = aws_wafv2_web_acl.main.arn
}