Skip to content

Resource: awsWafregionalRule

Provides an WAF Regional Rule Resource for use with Application Load Balancer.

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 awsWafregionalIpsetIpset = new aws.wafregionalIpset.WafregionalIpset(
  this,
  "ipset",
  {
    ipSetDescriptor: [
      {
        type: "IPV4",
        value: "192.0.7.0/24",
      },
    ],
    name: "tfIPSet",
  }
);
new aws.wafregionalRule.WafregionalRule(this, "wafrule", {
  metricName: "tfWAFRule",
  name: "tfWAFRule",
  predicate: [
    {
      dataId: awsWafregionalIpsetIpset.id,
      negated: false,
      type: "IPMatch",
    },
  ],
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name or description of the rule.
  • metricName - (Required) The name or description for the Amazon CloudWatch metric of this rule.
  • predicate - (Optional) The objects to include in a rule (documented 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 Fields

predicate

See the WAF Documentation for more information.

Arguments

  • type - (Required) The type of predicate in a rule. Valid values: byteMatch, geoMatch, ipMatch, regexMatch, sizeConstraint, sqlInjectionMatch, or xssMatch
  • dataId - (Required) The unique identifier of a predicate, such as the ID of a byteMatchSet or ipSet.
  • negated - (Required) Whether to use the settings or the negated settings that you specified in the objects.

Remarks

Attributes Reference

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

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

Import

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

$ terraform import aws_wafregional_rule.wafrule a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc