Skip to content

Resource: awsWafregionalRuleGroup

Provides a WAF Regional 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 awsWafregionalRuleExample = new aws.wafregionalRule.WafregionalRule(
  this,
  "example",
  {
    metricName: "example",
    name: "example",
  }
);
const awsWafregionalRuleGroupExample =
  new aws.wafregionalRuleGroup.WafregionalRuleGroup(this, "example_1", {
    activatedRule: [
      {
        action: {
          type: "COUNT",
        },
        priority: 50,
        ruleId: awsWafregionalRuleExample.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.*/
awsWafregionalRuleGroupExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) A friendly name of the rule group
  • metricName - (Required) A friendly name for the metrics from the rule group
  • activatedRule - (Optional) A list of activated rules, see below
  • tags - (Optional) Key-value map of resource tags. If configured with a provider defaultTags 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, 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.
  • ruleId - (Required) The ID of a rule
  • type - (Optional) The rule type, either regular, RATE_BASED, or group. Defaults to regular.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the WAF Regional Rule Group.
  • arn - The ARN of the WAF Regional Rule Group.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

WAF Regional Rule Group can be imported using the id, e.g.,

$ terraform import aws_wafregional_rule_group.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc