Skip to content

Resource: awsWafregionalRegexMatchSet

Provides a WAF Regional Regex Match Set 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 awsWafregionalRegexPatternSetExample =
  new aws.wafregionalRegexPatternSet.WafregionalRegexPatternSet(
    this,
    "example",
    {
      name: "example",
      regexPatternStrings: ["one", "two"],
    }
  );
const awsWafregionalRegexMatchSetExample =
  new aws.wafregionalRegexMatchSet.WafregionalRegexMatchSet(this, "example_1", {
    name: "example",
    regexMatchTuple: [
      {
        fieldToMatch: {
          data: "User-Agent",
          type: "HEADER",
        },
        regexPatternSetId: awsWafregionalRegexPatternSetExample.id,
        textTransformation: "NONE",
      },
    ],
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsWafregionalRegexMatchSetExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name or description of the Regex Match Set.
  • regexMatchTuple - (Required) The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.

Nested Arguments

regexMatchTuple

  • fieldToMatch - (Required) The part of a web request that you want to search, such as a specified header or a query string.
  • regexPatternSetId - (Required) The ID of a Regex Pattern Set.
  • textTransformation - (Required) Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. e.g., CMD_LINE, HTML_ENTITY_DECODE or none. See docs for all supported values.

fieldToMatch

  • data - (Optional) When type is header, enter the name of the header that you want to search, e.g., userAgent or referer. If type is any other value, omit this field.
  • type - (Required) The part of the web request that you want AWS WAF to search for a specified string. e.g., header, method or body. See docs for all supported values.

Attributes Reference

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

  • id - The ID of the WAF Regional Regex Match Set.

Import

WAF Regional Regex Match Set can be imported using the id, e.g.,

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