aws logo
AWS Classic v5.29.0, Feb 1 23

aws.wafv2.RegexPatternSet

Provides an AWS WAFv2 Regex Pattern Set Resource

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.WafV2.RegexPatternSet("example", new()
    {
        Description = "Example regex pattern set",
        RegularExpressions = new[]
        {
            new Aws.WafV2.Inputs.RegexPatternSetRegularExpressionArgs
            {
                RegexString = "one",
            },
            new Aws.WafV2.Inputs.RegexPatternSetRegularExpressionArgs
            {
                RegexString = "two",
            },
        },
        Scope = "REGIONAL",
        Tags = 
        {
            { "Tag1", "Value1" },
            { "Tag2", "Value2" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/wafv2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := wafv2.NewRegexPatternSet(ctx, "example", &wafv2.RegexPatternSetArgs{
			Description: pulumi.String("Example regex pattern set"),
			RegularExpressions: wafv2.RegexPatternSetRegularExpressionArray{
				&wafv2.RegexPatternSetRegularExpressionArgs{
					RegexString: pulumi.String("one"),
				},
				&wafv2.RegexPatternSetRegularExpressionArgs{
					RegexString: pulumi.String("two"),
				},
			},
			Scope: pulumi.String("REGIONAL"),
			Tags: pulumi.StringMap{
				"Tag1": pulumi.String("Value1"),
				"Tag2": pulumi.String("Value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.wafv2.RegexPatternSet;
import com.pulumi.aws.wafv2.RegexPatternSetArgs;
import com.pulumi.aws.wafv2.inputs.RegexPatternSetRegularExpressionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new RegexPatternSet("example", RegexPatternSetArgs.builder()        
            .description("Example regex pattern set")
            .regularExpressions(            
                RegexPatternSetRegularExpressionArgs.builder()
                    .regexString("one")
                    .build(),
                RegexPatternSetRegularExpressionArgs.builder()
                    .regexString("two")
                    .build())
            .scope("REGIONAL")
            .tags(Map.ofEntries(
                Map.entry("Tag1", "Value1"),
                Map.entry("Tag2", "Value2")
            ))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.wafv2.RegexPatternSet("example",
    description="Example regex pattern set",
    regular_expressions=[
        aws.wafv2.RegexPatternSetRegularExpressionArgs(
            regex_string="one",
        ),
        aws.wafv2.RegexPatternSetRegularExpressionArgs(
            regex_string="two",
        ),
    ],
    scope="REGIONAL",
    tags={
        "Tag1": "Value1",
        "Tag2": "Value2",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.wafv2.RegexPatternSet("example", {
    description: "Example regex pattern set",
    regularExpressions: [
        {
            regexString: "one",
        },
        {
            regexString: "two",
        },
    ],
    scope: "REGIONAL",
    tags: {
        Tag1: "Value1",
        Tag2: "Value2",
    },
});
resources:
  example:
    type: aws:wafv2:RegexPatternSet
    properties:
      description: Example regex pattern set
      regularExpressions:
        - regexString: one
        - regexString: two
      scope: REGIONAL
      tags:
        Tag1: Value1
        Tag2: Value2

Create RegexPatternSet Resource

new RegexPatternSet(name: string, args: RegexPatternSetArgs, opts?: CustomResourceOptions);
@overload
def RegexPatternSet(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    description: Optional[str] = None,
                    name: Optional[str] = None,
                    regular_expressions: Optional[Sequence[RegexPatternSetRegularExpressionArgs]] = None,
                    scope: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None)
@overload
def RegexPatternSet(resource_name: str,
                    args: RegexPatternSetArgs,
                    opts: Optional[ResourceOptions] = None)
func NewRegexPatternSet(ctx *Context, name string, args RegexPatternSetArgs, opts ...ResourceOption) (*RegexPatternSet, error)
public RegexPatternSet(string name, RegexPatternSetArgs args, CustomResourceOptions? opts = null)
public RegexPatternSet(String name, RegexPatternSetArgs args)
public RegexPatternSet(String name, RegexPatternSetArgs args, CustomResourceOptions options)
type: aws:wafv2:RegexPatternSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args RegexPatternSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RegexPatternSetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RegexPatternSetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RegexPatternSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args RegexPatternSetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

RegexPatternSet Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The RegexPatternSet resource accepts the following input properties:

Scope string

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.

Description string

A friendly description of the regular expression pattern set.

Name string

A friendly name of the regular expression pattern set.

RegularExpressions List<Pulumi.Aws.WafV2.Inputs.RegexPatternSetRegularExpressionArgs>

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 Dictionary<string, string>

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.

Scope string

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.

Description string

A friendly description of the regular expression pattern set.

Name string

A friendly name of the regular expression pattern set.

RegularExpressions []RegexPatternSetRegularExpressionArgs

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 map[string]string

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.

scope String

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.

description String

A friendly description of the regular expression pattern set.

name String

A friendly name of the regular expression pattern set.

regularExpressions List<RegexPatternSetRegularExpressionArgs>

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 Map<String,String>

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.

scope string

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.

description string

A friendly description of the regular expression pattern set.

name string

A friendly name of the regular expression pattern set.

regularExpressions RegexPatternSetRegularExpressionArgs[]

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 {[key: string]: string}

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.

scope str

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.

description str

A friendly description of the regular expression pattern set.

name str

A friendly name of the regular expression pattern set.

regular_expressions Sequence[RegexPatternSetRegularExpressionArgs]

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 Mapping[str, str]

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.

scope String

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.

description String

A friendly description of the regular expression pattern set.

name String

A friendly name of the regular expression pattern set.

regularExpressions List<Property Map>

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 Map<String>

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the RegexPatternSet resource produces the following output properties:

Arn string

The Amazon Resource Name (ARN) that identifies the cluster.

Id string

The provider-assigned unique ID for this managed resource.

LockToken string
TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The Amazon Resource Name (ARN) that identifies the cluster.

Id string

The provider-assigned unique ID for this managed resource.

LockToken string
TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name (ARN) that identifies the cluster.

id String

The provider-assigned unique ID for this managed resource.

lockToken String
tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The Amazon Resource Name (ARN) that identifies the cluster.

id string

The provider-assigned unique ID for this managed resource.

lockToken string
tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The Amazon Resource Name (ARN) that identifies the cluster.

id str

The provider-assigned unique ID for this managed resource.

lock_token str
tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name (ARN) that identifies the cluster.

id String

The provider-assigned unique ID for this managed resource.

lockToken String
tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing RegexPatternSet Resource

Get an existing RegexPatternSet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RegexPatternSetState, opts?: CustomResourceOptions): RegexPatternSet
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        description: Optional[str] = None,
        lock_token: Optional[str] = None,
        name: Optional[str] = None,
        regular_expressions: Optional[Sequence[RegexPatternSetRegularExpressionArgs]] = None,
        scope: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> RegexPatternSet
func GetRegexPatternSet(ctx *Context, name string, id IDInput, state *RegexPatternSetState, opts ...ResourceOption) (*RegexPatternSet, error)
public static RegexPatternSet Get(string name, Input<string> id, RegexPatternSetState? state, CustomResourceOptions? opts = null)
public static RegexPatternSet get(String name, Output<String> id, RegexPatternSetState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

The Amazon Resource Name (ARN) that identifies the cluster.

Description string

A friendly description of the regular expression pattern set.

LockToken string
Name string

A friendly name of the regular expression pattern set.

RegularExpressions List<Pulumi.Aws.WafV2.Inputs.RegexPatternSetRegularExpressionArgs>

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.

Scope string

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.

Tags Dictionary<string, string>

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.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The Amazon Resource Name (ARN) that identifies the cluster.

Description string

A friendly description of the regular expression pattern set.

LockToken string
Name string

A friendly name of the regular expression pattern set.

RegularExpressions []RegexPatternSetRegularExpressionArgs

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.

Scope string

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.

Tags map[string]string

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.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name (ARN) that identifies the cluster.

description String

A friendly description of the regular expression pattern set.

lockToken String
name String

A friendly name of the regular expression pattern set.

regularExpressions List<RegexPatternSetRegularExpressionArgs>

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.

scope String

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.

tags Map<String,String>

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.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The Amazon Resource Name (ARN) that identifies the cluster.

description string

A friendly description of the regular expression pattern set.

lockToken string
name string

A friendly name of the regular expression pattern set.

regularExpressions RegexPatternSetRegularExpressionArgs[]

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.

scope string

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.

tags {[key: string]: string}

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.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The Amazon Resource Name (ARN) that identifies the cluster.

description str

A friendly description of the regular expression pattern set.

lock_token str
name str

A friendly name of the regular expression pattern set.

regular_expressions Sequence[RegexPatternSetRegularExpressionArgs]

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.

scope str

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.

tags Mapping[str, str]

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.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name (ARN) that identifies the cluster.

description String

A friendly description of the regular expression pattern set.

lockToken String
name String

A friendly name of the regular expression pattern set.

regularExpressions List<Property Map>

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.

scope String

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.

tags Map<String>

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.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Supporting Types

RegexPatternSetRegularExpression

RegexString string

The string representing the regular expression, see the AWS WAF documentation for more information.

RegexString string

The string representing the regular expression, see the AWS WAF documentation for more information.

regexString String

The string representing the regular expression, see the AWS WAF documentation for more information.

regexString string

The string representing the regular expression, see the AWS WAF documentation for more information.

regex_string str

The string representing the regular expression, see the AWS WAF documentation for more information.

regexString String

The string representing the regular expression, see the AWS WAF documentation for more information.

Import

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

 $ pulumi import aws:wafv2/regexPatternSet:RegexPatternSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.