Provides an AWS WAFv2 Regex Pattern Set Resource
resource "aws_wafv2_regex_pattern_set" "example" {
name = "example"
description = "Example regex pattern set"
scope = "REGIONAL"
regular_expression {
regex_string = "one"
}
regular_expression {
regex_string = "two"
}
tags = {
Tag1 = "Value1"
Tag2 = "Value2"
}
}
This resource supports the following arguments:
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 us-east-1
(N. Virginia) on the AWS provider.regular_expression
- (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. A maximum of 10 regular_expression
blocks may be specified.tags
- (Optional) An array of key:value pairs to associate with the resource. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.regex_string
- (Required) The string representing the regular expression, see the AWS WAF documentation for more information.This resource exports the following attributes in addition to the arguments above:
id
- A unique identifier for the set.arn
- The Amazon Resource Name (ARN) that identifies the cluster.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.In Terraform v1.5.0 and later, use an import
block to import WAFv2 Regex Pattern Sets using ID/name/scope
. For example:
import {
to = aws_wafv2_regex_pattern_set.example
id = "a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL"
}
Using terraform import
, import WAFv2 Regex Pattern Sets using ID/name/scope
. For example:
% terraform import aws_wafv2_regex_pattern_set.example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL