Provides a WAF Regional Rule Group Resource
resource "aws_wafregional_rule" "example" {
name = "example"
metric_name = "example"
}
resource "aws_wafregional_rule_group" "example" {
name = "example"
metric_name = "example"
activated_rule {
action {
type = "COUNT"
}
priority = 50
rule_id = aws_wafregional_rule.example.id
}
}
This resource supports the following arguments:
name
- (Required) A friendly name of the rule groupmetric_name
- (Required) A friendly name for the metrics from the rule groupactivated_rule
- (Optional) A list of activated rules, see belowtags
- (Optional) Key-value map of resource tags. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.activated_rule
action
- (Required) Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
type
- (Required) e.g., BLOCK
, ALLOW
, or COUNT
priority
- (Required) Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.rule_id
- (Required) The ID of a ruletype
- (Optional) The rule type, either REGULAR
, RATE_BASED
, or GROUP
. Defaults to REGULAR
.This resource exports the following attributes in addition to the arguments above:
id
- The ID of the WAF Regional Rule Group.arn
- The ARN of the WAF Regional Rule Group.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import WAF Regional Rule Group using the id. For example:
import {
to = aws_wafregional_rule_group.example
id = "a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc"
}
Using terraform import
, import WAF Regional Rule Group using the id. For example:
% terraform import aws_wafregional_rule_group.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc