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

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

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

aws.waf.ByteMatchSet

Explore with Pulumi AI

aws logo

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

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

    Provides a WAF Byte Match Set Resource

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var byteSet = new Aws.Waf.ByteMatchSet("byteSet", new()
        {
            ByteMatchTuples = new[]
            {
                new Aws.Waf.Inputs.ByteMatchSetByteMatchTupleArgs
                {
                    FieldToMatch = new Aws.Waf.Inputs.ByteMatchSetByteMatchTupleFieldToMatchArgs
                    {
                        Data = "referer",
                        Type = "HEADER",
                    },
                    PositionalConstraint = "CONTAINS",
                    TargetString = "badrefer1",
                    TextTransformation = "NONE",
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/waf"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := waf.NewByteMatchSet(ctx, "byteSet", &waf.ByteMatchSetArgs{
    			ByteMatchTuples: waf.ByteMatchSetByteMatchTupleArray{
    				&waf.ByteMatchSetByteMatchTupleArgs{
    					FieldToMatch: &waf.ByteMatchSetByteMatchTupleFieldToMatchArgs{
    						Data: pulumi.String("referer"),
    						Type: pulumi.String("HEADER"),
    					},
    					PositionalConstraint: pulumi.String("CONTAINS"),
    					TargetString:         pulumi.String("badrefer1"),
    					TextTransformation:   pulumi.String("NONE"),
    				},
    			},
    		})
    		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.waf.ByteMatchSet;
    import com.pulumi.aws.waf.ByteMatchSetArgs;
    import com.pulumi.aws.waf.inputs.ByteMatchSetByteMatchTupleArgs;
    import com.pulumi.aws.waf.inputs.ByteMatchSetByteMatchTupleFieldToMatchArgs;
    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 byteSet = new ByteMatchSet("byteSet", ByteMatchSetArgs.builder()        
                .byteMatchTuples(ByteMatchSetByteMatchTupleArgs.builder()
                    .fieldToMatch(ByteMatchSetByteMatchTupleFieldToMatchArgs.builder()
                        .data("referer")
                        .type("HEADER")
                        .build())
                    .positionalConstraint("CONTAINS")
                    .targetString("badrefer1")
                    .textTransformation("NONE")
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    byte_set = aws.waf.ByteMatchSet("byteSet", byte_match_tuples=[aws.waf.ByteMatchSetByteMatchTupleArgs(
        field_to_match=aws.waf.ByteMatchSetByteMatchTupleFieldToMatchArgs(
            data="referer",
            type="HEADER",
        ),
        positional_constraint="CONTAINS",
        target_string="badrefer1",
        text_transformation="NONE",
    )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const byteSet = new aws.waf.ByteMatchSet("byteSet", {byteMatchTuples: [{
        fieldToMatch: {
            data: "referer",
            type: "HEADER",
        },
        positionalConstraint: "CONTAINS",
        targetString: "badrefer1",
        textTransformation: "NONE",
    }]});
    
    resources:
      byteSet:
        type: aws:waf:ByteMatchSet
        properties:
          byteMatchTuples:
            - fieldToMatch:
                data: referer
                type: HEADER
              positionalConstraint: CONTAINS
              targetString: badrefer1
              textTransformation: NONE
    

    Create ByteMatchSet Resource

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

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

    ByteMatchTuples List<ByteMatchSetByteMatchTupleArgs>

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    Name string

    The name or description of the Byte Match Set.

    ByteMatchTuples []ByteMatchSetByteMatchTupleArgs

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    Name string

    The name or description of the Byte Match Set.

    byteMatchTuples List<ByteMatchSetByteMatchTupleArgs>

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name String

    The name or description of the Byte Match Set.

    byteMatchTuples ByteMatchSetByteMatchTupleArgs[]

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name string

    The name or description of the Byte Match Set.

    byte_match_tuples Sequence[ByteMatchSetByteMatchTupleArgs]

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name str

    The name or description of the Byte Match Set.

    byteMatchTuples List<Property Map>

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name String

    The name or description of the Byte Match Set.

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    id string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing ByteMatchSet Resource

    Get an existing ByteMatchSet 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?: ByteMatchSetState, opts?: CustomResourceOptions): ByteMatchSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            byte_match_tuples: Optional[Sequence[ByteMatchSetByteMatchTupleArgs]] = None,
            name: Optional[str] = None) -> ByteMatchSet
    func GetByteMatchSet(ctx *Context, name string, id IDInput, state *ByteMatchSetState, opts ...ResourceOption) (*ByteMatchSet, error)
    public static ByteMatchSet Get(string name, Input<string> id, ByteMatchSetState? state, CustomResourceOptions? opts = null)
    public static ByteMatchSet get(String name, Output<String> id, ByteMatchSetState 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:
    ByteMatchTuples List<ByteMatchSetByteMatchTupleArgs>

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    Name string

    The name or description of the Byte Match Set.

    ByteMatchTuples []ByteMatchSetByteMatchTupleArgs

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    Name string

    The name or description of the Byte Match Set.

    byteMatchTuples List<ByteMatchSetByteMatchTupleArgs>

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name String

    The name or description of the Byte Match Set.

    byteMatchTuples ByteMatchSetByteMatchTupleArgs[]

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name string

    The name or description of the Byte Match Set.

    byte_match_tuples Sequence[ByteMatchSetByteMatchTupleArgs]

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name str

    The name or description of the Byte Match Set.

    byteMatchTuples List<Property Map>

    Specifies the bytes (typically a string that corresponds with ASCII characters) that you want to search for in web requests, the location in requests that you want to search, and other settings.

    name String

    The name or description of the Byte Match Set.

    Supporting Types

    ByteMatchSetByteMatchTuple

    FieldToMatch ByteMatchSetByteMatchTupleFieldToMatch

    The part of a web request that you want to search, such as a specified header or a query string.

    PositionalConstraint string

    Within the portion of a web request that you want to search (for example, in the query string, if any), specify where you want to search. e.g., CONTAINS, CONTAINS_WORD or EXACTLY. See docs for all supported values.

    TextTransformation string

    Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on target_string before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

    TargetString string

    The value that you want to search for within the field specified by field_to_match, e.g., badrefer1. See docs for all supported values.

    FieldToMatch ByteMatchSetByteMatchTupleFieldToMatch

    The part of a web request that you want to search, such as a specified header or a query string.

    PositionalConstraint string

    Within the portion of a web request that you want to search (for example, in the query string, if any), specify where you want to search. e.g., CONTAINS, CONTAINS_WORD or EXACTLY. See docs for all supported values.

    TextTransformation string

    Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on target_string before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

    TargetString string

    The value that you want to search for within the field specified by field_to_match, e.g., badrefer1. See docs for all supported values.

    fieldToMatch ByteMatchSetByteMatchTupleFieldToMatch

    The part of a web request that you want to search, such as a specified header or a query string.

    positionalConstraint String

    Within the portion of a web request that you want to search (for example, in the query string, if any), specify where you want to search. e.g., CONTAINS, CONTAINS_WORD or EXACTLY. See docs for all supported values.

    textTransformation String

    Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on target_string before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

    targetString String

    The value that you want to search for within the field specified by field_to_match, e.g., badrefer1. See docs for all supported values.

    fieldToMatch ByteMatchSetByteMatchTupleFieldToMatch

    The part of a web request that you want to search, such as a specified header or a query string.

    positionalConstraint string

    Within the portion of a web request that you want to search (for example, in the query string, if any), specify where you want to search. e.g., CONTAINS, CONTAINS_WORD or EXACTLY. See docs for all supported values.

    textTransformation string

    Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on target_string before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

    targetString string

    The value that you want to search for within the field specified by field_to_match, e.g., badrefer1. See docs for all supported values.

    field_to_match ByteMatchSetByteMatchTupleFieldToMatch

    The part of a web request that you want to search, such as a specified header or a query string.

    positional_constraint str

    Within the portion of a web request that you want to search (for example, in the query string, if any), specify where you want to search. e.g., CONTAINS, CONTAINS_WORD or EXACTLY. See docs for all supported values.

    text_transformation str

    Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on target_string before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

    target_string str

    The value that you want to search for within the field specified by field_to_match, e.g., badrefer1. 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.

    positionalConstraint String

    Within the portion of a web request that you want to search (for example, in the query string, if any), specify where you want to search. e.g., CONTAINS, CONTAINS_WORD or EXACTLY. See docs for all supported values.

    textTransformation String

    Text transformations used to eliminate unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on target_string before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values.

    targetString String

    The value that you want to search for within the field specified by field_to_match, e.g., badrefer1. See docs for all supported values.

    ByteMatchSetByteMatchTupleFieldToMatch

    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

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

     $ pulumi import aws:waf/byteMatchSet:ByteMatchSet byte_set 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 v5.41.0 published on Monday, May 15, 2023 by Pulumi