Resource: awsWafRuleGroup
Provides a WAF Rule Group Resource
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsWafRuleExample = new aws.wafRule.WafRule(this, "example", {
metricName: "example",
name: "example",
});
const awsWafRuleGroupExample = new aws.wafRuleGroup.WafRuleGroup(
this,
"example_1",
{
activatedRule: [
{
action: {
type: "COUNT",
},
priority: 50,
ruleId: awsWafRuleExample.id,
},
],
metricName: "example",
name: "example",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsWafRuleGroupExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
name
- (Required) A friendly name of the rule groupmetricName
- (Required) A friendly name for the metrics from the rule groupactivatedRule
- (Optional) A list of activated rules, see belowtags
- (Optional) Key-value map of resource tags. If configured with a providerdefaultTags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Nested Blocks
activatedRule
Arguments
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
, orcount
priority
- (Required) Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.ruleId
- (Required) The ID of a ruletype
- (Optional) The rule type, eitherregular
,RATE_BASED
, orgroup
. Defaults toregular
.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The ID of the WAF rule group.arn
- The ARN of the WAF rule group.tagsAll
- A map of tags assigned to the resource, including those inherited from the providerdefaultTags
configuration block.
Import
WAF Rule Group can be imported using the id, e.g.,