Skip to content

Resource: awsWafv2RegexPatternSet

Provides an AWS WAFv2 Regex Pattern 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";
new aws.wafv2RegexPatternSet.Wafv2RegexPatternSet(this, "example", {
  description: "Example regex pattern set",
  name: "example",
  regularExpression: [
    {
      regexString: "one",
    },
    {
      regexString: "two",
    },
  ],
  scope: "REGIONAL",
  tags: {
    Tag1: "Value1",
    Tag2: "Value2",
  },
});

Argument Reference

The following arguments are supported:

  • name - (Required) A friendly name of the regular expression pattern set.
  • description - (Optional) A friendly description of the regular expression pattern set.
  • scope - (Required) Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are cloudfront or regional. To work with CloudFront, you must also specify the region usEast1 (N. Virginia) on the AWS provider.
  • regularExpression - (Optional) One or more blocks of regular expression patterns that you want AWS WAF to search for, such as b[a@]dB[o0]t. See Regular Expression below for details.
  • tags - (Optional) An array of key:value pairs to associate with the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Regular Expression

  • regexString - (Required) The string representing the regular expression, see the AWS WAF documentation for more information.

Attributes Reference

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

  • id - A unique identifier for the set.
  • arn - The Amazon Resource Name (ARN) that identifies the cluster.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

WAFv2 Regex Pattern Sets can be imported using id/name/scope e.g.,

$ terraform import aws_wafv2_regex_pattern_set.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL