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

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

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.wafregional.ByteMatchSet

Explore with Pulumi AI

aws logo

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

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a WAF Regional Byte Match Set Resource for use with Application Load Balancer.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const byteSet = new aws.wafregional.ByteMatchSet("byte_set", {
        name: "my_waf_byte_match_set",
        byteMatchTuples: [{
            textTransformation: "NONE",
            targetString: "badrefer1",
            positionalConstraint: "CONTAINS",
            fieldToMatch: {
                type: "HEADER",
                data: "referer",
            },
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    byte_set = aws.wafregional.ByteMatchSet("byte_set",
        name="my_waf_byte_match_set",
        byte_match_tuples=[{
            "textTransformation": "NONE",
            "targetString": "badrefer1",
            "positionalConstraint": "CONTAINS",
            "fieldToMatch": {
                "type": "HEADER",
                "data": "referer",
            },
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafregional"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := wafregional.NewByteMatchSet(ctx, "byte_set", &wafregional.ByteMatchSetArgs{
    			Name: pulumi.String("my_waf_byte_match_set"),
    			ByteMatchTuples: wafregional.ByteMatchSetByteMatchTupleArray{
    				&wafregional.ByteMatchSetByteMatchTupleArgs{
    					TextTransformation:   pulumi.String("NONE"),
    					TargetString:         pulumi.String("badrefer1"),
    					PositionalConstraint: pulumi.String("CONTAINS"),
    					FieldToMatch: &wafregional.ByteMatchSetByteMatchTupleFieldToMatchArgs{
    						Type: pulumi.String("HEADER"),
    						Data: pulumi.String("referer"),
    					},
    				},
    			},
    		})
    		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 byteSet = new Aws.WafRegional.ByteMatchSet("byte_set", new()
        {
            Name = "my_waf_byte_match_set",
            ByteMatchTuples = new[]
            {
                new Aws.WafRegional.Inputs.ByteMatchSetByteMatchTupleArgs
                {
                    TextTransformation = "NONE",
                    TargetString = "badrefer1",
                    PositionalConstraint = "CONTAINS",
                    FieldToMatch = new Aws.WafRegional.Inputs.ByteMatchSetByteMatchTupleFieldToMatchArgs
                    {
                        Type = "HEADER",
                        Data = "referer",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.wafregional.ByteMatchSet;
    import com.pulumi.aws.wafregional.ByteMatchSetArgs;
    import com.pulumi.aws.wafregional.inputs.ByteMatchSetByteMatchTupleArgs;
    import com.pulumi.aws.wafregional.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()
                .name("my_waf_byte_match_set")
                .byteMatchTuples(ByteMatchSetByteMatchTupleArgs.builder()
                    .textTransformation("NONE")
                    .targetString("badrefer1")
                    .positionalConstraint("CONTAINS")
                    .fieldToMatch(ByteMatchSetByteMatchTupleFieldToMatchArgs.builder()
                        .type("HEADER")
                        .data("referer")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      byteSet:
        type: aws:wafregional:ByteMatchSet
        name: byte_set
        properties:
          name: my_waf_byte_match_set
          byteMatchTuples:
            - textTransformation: NONE
              targetString: badrefer1
              positionalConstraint: CONTAINS
              fieldToMatch:
                type: HEADER
                data: referer
    

    Create ByteMatchSet Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ByteMatchSet(name: string, args?: ByteMatchSetArgs, opts?: CustomResourceOptions);
    @overload
    def ByteMatchSet(resource_name: str,
                     args: Optional[ByteMatchSetArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ByteMatchSet(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     byte_match_tuples: Optional[Sequence[ByteMatchSetByteMatchTupleArgs]] = None,
                     name: Optional[str] = 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:wafregional:ByteMatchSet
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var awsByteMatchSetResource = new Aws.WafRegional.ByteMatchSet("awsByteMatchSetResource", new()
    {
        ByteMatchTuples = new[]
        {
            new Aws.WafRegional.Inputs.ByteMatchSetByteMatchTupleArgs
            {
                FieldToMatch = new Aws.WafRegional.Inputs.ByteMatchSetByteMatchTupleFieldToMatchArgs
                {
                    Type = "string",
                    Data = "string",
                },
                PositionalConstraint = "string",
                TextTransformation = "string",
                TargetString = "string",
            },
        },
        Name = "string",
    });
    
    example, err := wafregional.NewByteMatchSet(ctx, "awsByteMatchSetResource", &wafregional.ByteMatchSetArgs{
    	ByteMatchTuples: wafregional.ByteMatchSetByteMatchTupleArray{
    		&wafregional.ByteMatchSetByteMatchTupleArgs{
    			FieldToMatch: &wafregional.ByteMatchSetByteMatchTupleFieldToMatchArgs{
    				Type: pulumi.String("string"),
    				Data: pulumi.String("string"),
    			},
    			PositionalConstraint: pulumi.String("string"),
    			TextTransformation:   pulumi.String("string"),
    			TargetString:         pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var awsByteMatchSetResource = new ByteMatchSet("awsByteMatchSetResource", ByteMatchSetArgs.builder()
        .byteMatchTuples(ByteMatchSetByteMatchTupleArgs.builder()
            .fieldToMatch(ByteMatchSetByteMatchTupleFieldToMatchArgs.builder()
                .type("string")
                .data("string")
                .build())
            .positionalConstraint("string")
            .textTransformation("string")
            .targetString("string")
            .build())
        .name("string")
        .build());
    
    aws_byte_match_set_resource = aws.wafregional.ByteMatchSet("awsByteMatchSetResource",
        byte_match_tuples=[{
            "fieldToMatch": {
                "type": "string",
                "data": "string",
            },
            "positionalConstraint": "string",
            "textTransformation": "string",
            "targetString": "string",
        }],
        name="string")
    
    const awsByteMatchSetResource = new aws.wafregional.ByteMatchSet("awsByteMatchSetResource", {
        byteMatchTuples: [{
            fieldToMatch: {
                type: "string",
                data: "string",
            },
            positionalConstraint: "string",
            textTransformation: "string",
            targetString: "string",
        }],
        name: "string",
    });
    
    type: aws:wafregional:ByteMatchSet
    properties:
        byteMatchTuples:
            - fieldToMatch:
                data: string
                type: string
              positionalConstraint: string
              targetString: string
              textTransformation: string
        name: string
    

    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<ByteMatchSetByteMatchTuple>
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    Name string
    The name or description of the ByteMatchSet.
    ByteMatchTuples []ByteMatchSetByteMatchTupleArgs
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    Name string
    The name or description of the ByteMatchSet.
    byteMatchTuples List<ByteMatchSetByteMatchTuple>
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name String
    The name or description of the ByteMatchSet.
    byteMatchTuples ByteMatchSetByteMatchTuple[]
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name string
    The name or description of the ByteMatchSet.
    byte_match_tuples Sequence[ByteMatchSetByteMatchTupleArgs]
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name str
    The name or description of the ByteMatchSet.
    byteMatchTuples List<Property Map>
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name String
    The name or description of the ByteMatchSet.

    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<ByteMatchSetByteMatchTuple>
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    Name string
    The name or description of the ByteMatchSet.
    ByteMatchTuples []ByteMatchSetByteMatchTupleArgs
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    Name string
    The name or description of the ByteMatchSet.
    byteMatchTuples List<ByteMatchSetByteMatchTuple>
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name String
    The name or description of the ByteMatchSet.
    byteMatchTuples ByteMatchSetByteMatchTuple[]
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name string
    The name or description of the ByteMatchSet.
    byte_match_tuples Sequence[ByteMatchSetByteMatchTupleArgs]
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name str
    The name or description of the ByteMatchSet.
    byteMatchTuples List<Property Map>
    Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below.
    name String
    The name or description of the ByteMatchSet.

    Supporting Types

    ByteMatchSetByteMatchTuple, ByteMatchSetByteMatchTupleArgs

    FieldToMatch ByteMatchSetByteMatchTupleFieldToMatch
    Settings for the ByteMatchTuple. FieldToMatch documented below.
    PositionalConstraint string
    Within the portion of a web request that you want to search.
    TextTransformation string

    The formatting way for web request.

    FieldToMatch(field_to_match) support following:

    TargetString string
    The value that you want AWS WAF to search for. The maximum length of the value is 50 bytes.
    FieldToMatch ByteMatchSetByteMatchTupleFieldToMatch
    Settings for the ByteMatchTuple. FieldToMatch documented below.
    PositionalConstraint string
    Within the portion of a web request that you want to search.
    TextTransformation string

    The formatting way for web request.

    FieldToMatch(field_to_match) support following:

    TargetString string
    The value that you want AWS WAF to search for. The maximum length of the value is 50 bytes.
    fieldToMatch ByteMatchSetByteMatchTupleFieldToMatch
    Settings for the ByteMatchTuple. FieldToMatch documented below.
    positionalConstraint String
    Within the portion of a web request that you want to search.
    textTransformation String

    The formatting way for web request.

    FieldToMatch(field_to_match) support following:

    targetString String
    The value that you want AWS WAF to search for. The maximum length of the value is 50 bytes.
    fieldToMatch ByteMatchSetByteMatchTupleFieldToMatch
    Settings for the ByteMatchTuple. FieldToMatch documented below.
    positionalConstraint string
    Within the portion of a web request that you want to search.
    textTransformation string

    The formatting way for web request.

    FieldToMatch(field_to_match) support following:

    targetString string
    The value that you want AWS WAF to search for. The maximum length of the value is 50 bytes.
    field_to_match ByteMatchSetByteMatchTupleFieldToMatch
    Settings for the ByteMatchTuple. FieldToMatch documented below.
    positional_constraint str
    Within the portion of a web request that you want to search.
    text_transformation str

    The formatting way for web request.

    FieldToMatch(field_to_match) support following:

    target_string str
    The value that you want AWS WAF to search for. The maximum length of the value is 50 bytes.
    fieldToMatch Property Map
    Settings for the ByteMatchTuple. FieldToMatch documented below.
    positionalConstraint String
    Within the portion of a web request that you want to search.
    textTransformation String

    The formatting way for web request.

    FieldToMatch(field_to_match) support following:

    targetString String
    The value that you want AWS WAF to search for. The maximum length of the value is 50 bytes.

    ByteMatchSetByteMatchTupleFieldToMatch, ByteMatchSetByteMatchTupleFieldToMatchArgs

    Type string
    The part of the web request that you want AWS WAF to search for a specified string.
    Data string
    When the value of Type is HEADER, enter the name of the header that you want AWS WAF to search, for example, User-Agent or Referer. If the value of Type is any other value, omit Data.
    Type string
    The part of the web request that you want AWS WAF to search for a specified string.
    Data string
    When the value of Type is HEADER, enter the name of the header that you want AWS WAF to search, for example, User-Agent or Referer. If the value of Type is any other value, omit Data.
    type String
    The part of the web request that you want AWS WAF to search for a specified string.
    data String
    When the value of Type is HEADER, enter the name of the header that you want AWS WAF to search, for example, User-Agent or Referer. If the value of Type is any other value, omit Data.
    type string
    The part of the web request that you want AWS WAF to search for a specified string.
    data string
    When the value of Type is HEADER, enter the name of the header that you want AWS WAF to search, for example, User-Agent or Referer. If the value of Type is any other value, omit Data.
    type str
    The part of the web request that you want AWS WAF to search for a specified string.
    data str
    When the value of Type is HEADER, enter the name of the header that you want AWS WAF to search, for example, User-Agent or Referer. If the value of Type is any other value, omit Data.
    type String
    The part of the web request that you want AWS WAF to search for a specified string.
    data String
    When the value of Type is HEADER, enter the name of the header that you want AWS WAF to search, for example, User-Agent or Referer. If the value of Type is any other value, omit Data.

    Import

    Using pulumi import, import WAF Regional Byte Match Set using the id. For example:

    $ pulumi import aws:wafregional/byteMatchSet:ByteMatchSet byte_set a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.42.0 published on Wednesday, Jun 26, 2024 by Pulumi