-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path3-aws-waf-geo.tf
45 lines (39 loc) · 1.16 KB
/
3-aws-waf-geo.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
#
# Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#-----use this resource to create your geo location rule ----------------------------
# Not part of AWS FM WAF policy by default
resource "aws_wafv2_rule_group" "GeoRuleGroup" {
count = var.create_waf_geo_rule_group ? 1 : 0
provider = aws.regional
name = "${var.regional_policy_name}-GeoRuleGroup"
scope = "REGIONAL"
capacity = 60
rule {
name = "GeoLocation-Based-BlockList"
priority = 1
action {
block {}
}
statement {
geo_match_statement {
country_codes = var.waf_rule_geo_country_list
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "GeoLocation-BlockList-metric"
sampled_requests_enabled = true
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "WAFCUSTGeoRuleGroupMetric"
sampled_requests_enabled = true
}
}