1. Packages
  2. AWS Classic
  3. API Docs
  4. waf
  5. RegexMatchSet

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

aws.waf.RegexMatchSet

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

    Provides a WAF Regex Match Set Resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const exampleRegexPatternSet = new aws.waf.RegexPatternSet("example", {
        name: "example",
        regexPatternStrings: [
            "one",
            "two",
        ],
    });
    const example = new aws.waf.RegexMatchSet("example", {
        name: "example",
        regexMatchTuples: [{
            fieldToMatch: {
                data: "User-Agent",
                type: "HEADER",
            },
            regexPatternSetId: exampleRegexPatternSet.id,
            textTransformation: "NONE",
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example_regex_pattern_set = aws.waf.RegexPatternSet("example",
        name="example",
        regex_pattern_strings=[
            "one",
            "two",
        ])
    example = aws.waf.RegexMatchSet("example",
        name="example",
        regex_match_tuples=[aws.waf.RegexMatchSetRegexMatchTupleArgs(
            field_to_match=aws.waf.RegexMatchSetRegexMatchTupleFieldToMatchArgs(
                data="User-Agent",
                type="HEADER",
            ),
            regex_pattern_set_id=example_regex_pattern_set.id,
            text_transformation="NONE",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/waf"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleRegexPatternSet, err := waf.NewRegexPatternSet(ctx, "example", &waf.RegexPatternSetArgs{
    			Name: pulumi.String("example"),
    			RegexPatternStrings: pulumi.StringArray{
    				pulumi.String("one"),
    				pulumi.String("two"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = waf.NewRegexMatchSet(ctx, "example", &waf.RegexMatchSetArgs{
    			Name: pulumi.String("example"),
    			RegexMatchTuples: waf.RegexMatchSetRegexMatchTupleArray{
    				&waf.RegexMatchSetRegexMatchTupleArgs{
    					FieldToMatch: &waf.RegexMatchSetRegexMatchTupleFieldToMatchArgs{
    						Data: pulumi.String("User-Agent"),
    						Type: pulumi.String("HEADER"),
    					},
    					RegexPatternSetId:  exampleRegexPatternSet.ID(),
    					TextTransformation: pulumi.String("NONE"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleRegexPatternSet = new Aws.Waf.RegexPatternSet("example", new()
        {
            Name = "example",
            RegexPatternStrings = new[]
            {
                "one",
                "two",
            },
        });
    
        var example = new Aws.Waf.RegexMatchSet("example", new()
        {
            Name = "example",
            RegexMatchTuples = new[]
            {
                new Aws.Waf.Inputs.RegexMatchSetRegexMatchTupleArgs
                {
                    FieldToMatch = new Aws.Waf.Inputs.RegexMatchSetRegexMatchTupleFieldToMatchArgs
                    {
                        Data = "User-Agent",
                        Type = "HEADER",
                    },
                    RegexPatternSetId = exampleRegexPatternSet.Id,
                    TextTransformation = "NONE",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.waf.RegexPatternSet;
    import com.pulumi.aws.waf.RegexPatternSetArgs;
    import com.pulumi.aws.waf.RegexMatchSet;
    import com.pulumi.aws.waf.RegexMatchSetArgs;
    import com.pulumi.aws.waf.inputs.RegexMatchSetRegexMatchTupleArgs;
    import com.pulumi.aws.waf.inputs.RegexMatchSetRegexMatchTupleFieldToMatchArgs;
    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 exampleRegexPatternSet = new RegexPatternSet("exampleRegexPatternSet", RegexPatternSetArgs.builder()        
                .name("example")
                .regexPatternStrings(            
                    "one",
                    "two")
                .build());
    
            var example = new RegexMatchSet("example", RegexMatchSetArgs.builder()        
                .name("example")
                .regexMatchTuples(RegexMatchSetRegexMatchTupleArgs.builder()
                    .fieldToMatch(RegexMatchSetRegexMatchTupleFieldToMatchArgs.builder()
                        .data("User-Agent")
                        .type("HEADER")
                        .build())
                    .regexPatternSetId(exampleRegexPatternSet.id())
                    .textTransformation("NONE")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:waf:RegexMatchSet
        properties:
          name: example
          regexMatchTuples:
            - fieldToMatch:
                data: User-Agent
                type: HEADER
              regexPatternSetId: ${exampleRegexPatternSet.id}
              textTransformation: NONE
      exampleRegexPatternSet:
        type: aws:waf:RegexPatternSet
        name: example
        properties:
          name: example
          regexPatternStrings:
            - one
            - two
    

    Create RegexMatchSet Resource

    new RegexMatchSet(name: string, args?: RegexMatchSetArgs, opts?: CustomResourceOptions);
    @overload
    def RegexMatchSet(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      name: Optional[str] = None,
                      regex_match_tuples: Optional[Sequence[RegexMatchSetRegexMatchTupleArgs]] = None)
    @overload
    def RegexMatchSet(resource_name: str,
                      args: Optional[RegexMatchSetArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    func NewRegexMatchSet(ctx *Context, name string, args *RegexMatchSetArgs, opts ...ResourceOption) (*RegexMatchSet, error)
    public RegexMatchSet(string name, RegexMatchSetArgs? args = null, CustomResourceOptions? opts = null)
    public RegexMatchSet(String name, RegexMatchSetArgs args)
    public RegexMatchSet(String name, RegexMatchSetArgs args, CustomResourceOptions options)
    
    type: aws:waf:RegexMatchSet
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RegexMatchSetArgs
    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 RegexMatchSetArgs
    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 RegexMatchSetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegexMatchSetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegexMatchSetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RegexMatchSet 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 RegexMatchSet resource accepts the following input properties:

    Name string
    The name or description of the Regex Match Set.
    RegexMatchTuples List<RegexMatchSetRegexMatchTuple>
    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.
    Name string
    The name or description of the Regex Match Set.
    RegexMatchTuples []RegexMatchSetRegexMatchTupleArgs
    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.
    name String
    The name or description of the Regex Match Set.
    regexMatchTuples List<RegexMatchSetRegexMatchTuple>
    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.
    name string
    The name or description of the Regex Match Set.
    regexMatchTuples RegexMatchSetRegexMatchTuple[]
    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.
    name str
    The name or description of the Regex Match Set.
    regex_match_tuples Sequence[RegexMatchSetRegexMatchTupleArgs]
    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.
    name String
    The name or description of the Regex Match Set.
    regexMatchTuples List<Property Map>
    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.

    Outputs

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

    Arn string
    Amazon Resource Name (ARN)
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    Amazon Resource Name (ARN)
    Id string
    The provider-assigned unique ID for this managed resource.
    arn String
    Amazon Resource Name (ARN)
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    Amazon Resource Name (ARN)
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    Amazon Resource Name (ARN)
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    Amazon Resource Name (ARN)
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RegexMatchSet Resource

    Get an existing RegexMatchSet 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?: RegexMatchSetState, opts?: CustomResourceOptions): RegexMatchSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            name: Optional[str] = None,
            regex_match_tuples: Optional[Sequence[RegexMatchSetRegexMatchTupleArgs]] = None) -> RegexMatchSet
    func GetRegexMatchSet(ctx *Context, name string, id IDInput, state *RegexMatchSetState, opts ...ResourceOption) (*RegexMatchSet, error)
    public static RegexMatchSet Get(string name, Input<string> id, RegexMatchSetState? state, CustomResourceOptions? opts = null)
    public static RegexMatchSet get(String name, Output<String> id, RegexMatchSetState 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
    Amazon Resource Name (ARN)
    Name string
    The name or description of the Regex Match Set.
    RegexMatchTuples List<RegexMatchSetRegexMatchTuple>
    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.
    Arn string
    Amazon Resource Name (ARN)
    Name string
    The name or description of the Regex Match Set.
    RegexMatchTuples []RegexMatchSetRegexMatchTupleArgs
    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.
    arn String
    Amazon Resource Name (ARN)
    name String
    The name or description of the Regex Match Set.
    regexMatchTuples List<RegexMatchSetRegexMatchTuple>
    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.
    arn string
    Amazon Resource Name (ARN)
    name string
    The name or description of the Regex Match Set.
    regexMatchTuples RegexMatchSetRegexMatchTuple[]
    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.
    arn str
    Amazon Resource Name (ARN)
    name str
    The name or description of the Regex Match Set.
    regex_match_tuples Sequence[RegexMatchSetRegexMatchTupleArgs]
    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.
    arn String
    Amazon Resource Name (ARN)
    name String
    The name or description of the Regex Match Set.
    regexMatchTuples List<Property Map>
    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.

    Supporting Types

    RegexMatchSetRegexMatchTuple, RegexMatchSetRegexMatchTupleArgs

    FieldToMatch RegexMatchSetRegexMatchTupleFieldToMatch
    The part of a web request that you want to search, such as a specified header or a query string.
    RegexPatternSetId string
    The ID of a Regex Pattern Set.
    TextTransformation string
    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 RegexMatchSetRegexMatchTupleFieldToMatch
    The part of a web request that you want to search, such as a specified header or a query string.
    RegexPatternSetId string
    The ID of a Regex Pattern Set.
    TextTransformation string
    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 RegexMatchSetRegexMatchTupleFieldToMatch
    The part of a web request that you want to search, such as a specified header or a query string.
    regexPatternSetId String
    The ID of a Regex Pattern Set.
    textTransformation String
    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 RegexMatchSetRegexMatchTupleFieldToMatch
    The part of a web request that you want to search, such as a specified header or a query string.
    regexPatternSetId string
    The ID of a Regex Pattern Set.
    textTransformation string
    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.
    field_to_match RegexMatchSetRegexMatchTupleFieldToMatch
    The part of a web request that you want to search, such as a specified header or a query string.
    regex_pattern_set_id str
    The ID of a Regex Pattern Set.
    text_transformation str
    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 Property Map
    The part of a web request that you want to search, such as a specified header or a query string.
    regexPatternSetId String
    The ID of a Regex Pattern Set.
    textTransformation String
    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.

    RegexMatchSetRegexMatchTupleFieldToMatch, RegexMatchSetRegexMatchTupleFieldToMatchArgs

    Type string
    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.
    Data string
    When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
    Type string
    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.
    Data string
    When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
    type String
    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.
    data String
    When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
    type string
    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.
    data string
    When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
    type str
    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.
    data str
    When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.
    type String
    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.
    data String
    When type is HEADER, enter the name of the header that you want to search, e.g., User-Agent or Referer. If type is any other value, omit this field.

    Import

    Using pulumi import, import WAF Regex Match Set using their ID. For example:

    $ pulumi import aws:waf/regexMatchSet:RegexMatchSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi