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

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

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

aws.waf.SizeConstraintSet

Explore with Pulumi AI

aws logo

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

AWS Classic v6.32.0 published on Friday, Apr 19, 2024 by Pulumi

    Use the aws.waf.SizeConstraintSet resource to manage WAF size constraint sets.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const sizeConstraintSet = new aws.waf.SizeConstraintSet("size_constraint_set", {
        name: "tfsize_constraints",
        sizeConstraints: [{
            textTransformation: "NONE",
            comparisonOperator: "EQ",
            size: 4096,
            fieldToMatch: {
                type: "BODY",
            },
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    size_constraint_set = aws.waf.SizeConstraintSet("size_constraint_set",
        name="tfsize_constraints",
        size_constraints=[aws.waf.SizeConstraintSetSizeConstraintArgs(
            text_transformation="NONE",
            comparison_operator="EQ",
            size=4096,
            field_to_match=aws.waf.SizeConstraintSetSizeConstraintFieldToMatchArgs(
                type="BODY",
            ),
        )])
    
    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 {
    		_, err := waf.NewSizeConstraintSet(ctx, "size_constraint_set", &waf.SizeConstraintSetArgs{
    			Name: pulumi.String("tfsize_constraints"),
    			SizeConstraints: waf.SizeConstraintSetSizeConstraintArray{
    				&waf.SizeConstraintSetSizeConstraintArgs{
    					TextTransformation: pulumi.String("NONE"),
    					ComparisonOperator: pulumi.String("EQ"),
    					Size:               pulumi.Int(4096),
    					FieldToMatch: &waf.SizeConstraintSetSizeConstraintFieldToMatchArgs{
    						Type: pulumi.String("BODY"),
    					},
    				},
    			},
    		})
    		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 sizeConstraintSet = new Aws.Waf.SizeConstraintSet("size_constraint_set", new()
        {
            Name = "tfsize_constraints",
            SizeConstraints = new[]
            {
                new Aws.Waf.Inputs.SizeConstraintSetSizeConstraintArgs
                {
                    TextTransformation = "NONE",
                    ComparisonOperator = "EQ",
                    Size = 4096,
                    FieldToMatch = new Aws.Waf.Inputs.SizeConstraintSetSizeConstraintFieldToMatchArgs
                    {
                        Type = "BODY",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.waf.SizeConstraintSet;
    import com.pulumi.aws.waf.SizeConstraintSetArgs;
    import com.pulumi.aws.waf.inputs.SizeConstraintSetSizeConstraintArgs;
    import com.pulumi.aws.waf.inputs.SizeConstraintSetSizeConstraintFieldToMatchArgs;
    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 sizeConstraintSet = new SizeConstraintSet("sizeConstraintSet", SizeConstraintSetArgs.builder()        
                .name("tfsize_constraints")
                .sizeConstraints(SizeConstraintSetSizeConstraintArgs.builder()
                    .textTransformation("NONE")
                    .comparisonOperator("EQ")
                    .size("4096")
                    .fieldToMatch(SizeConstraintSetSizeConstraintFieldToMatchArgs.builder()
                        .type("BODY")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      sizeConstraintSet:
        type: aws:waf:SizeConstraintSet
        name: size_constraint_set
        properties:
          name: tfsize_constraints
          sizeConstraints:
            - textTransformation: NONE
              comparisonOperator: EQ
              size: '4096'
              fieldToMatch:
                type: BODY
    

    Create SizeConstraintSet Resource

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

    Constructor syntax

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

    Example

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

    var sizeConstraintSetResource = new Aws.Waf.SizeConstraintSet("sizeConstraintSetResource", new()
    {
        Name = "string",
        SizeConstraints = new[]
        {
            new Aws.Waf.Inputs.SizeConstraintSetSizeConstraintArgs
            {
                ComparisonOperator = "string",
                FieldToMatch = new Aws.Waf.Inputs.SizeConstraintSetSizeConstraintFieldToMatchArgs
                {
                    Type = "string",
                    Data = "string",
                },
                Size = 0,
                TextTransformation = "string",
            },
        },
    });
    
    example, err := waf.NewSizeConstraintSet(ctx, "sizeConstraintSetResource", &waf.SizeConstraintSetArgs{
    	Name: pulumi.String("string"),
    	SizeConstraints: waf.SizeConstraintSetSizeConstraintArray{
    		&waf.SizeConstraintSetSizeConstraintArgs{
    			ComparisonOperator: pulumi.String("string"),
    			FieldToMatch: &waf.SizeConstraintSetSizeConstraintFieldToMatchArgs{
    				Type: pulumi.String("string"),
    				Data: pulumi.String("string"),
    			},
    			Size:               pulumi.Int(0),
    			TextTransformation: pulumi.String("string"),
    		},
    	},
    })
    
    var sizeConstraintSetResource = new SizeConstraintSet("sizeConstraintSetResource", SizeConstraintSetArgs.builder()        
        .name("string")
        .sizeConstraints(SizeConstraintSetSizeConstraintArgs.builder()
            .comparisonOperator("string")
            .fieldToMatch(SizeConstraintSetSizeConstraintFieldToMatchArgs.builder()
                .type("string")
                .data("string")
                .build())
            .size(0)
            .textTransformation("string")
            .build())
        .build());
    
    size_constraint_set_resource = aws.waf.SizeConstraintSet("sizeConstraintSetResource",
        name="string",
        size_constraints=[aws.waf.SizeConstraintSetSizeConstraintArgs(
            comparison_operator="string",
            field_to_match=aws.waf.SizeConstraintSetSizeConstraintFieldToMatchArgs(
                type="string",
                data="string",
            ),
            size=0,
            text_transformation="string",
        )])
    
    const sizeConstraintSetResource = new aws.waf.SizeConstraintSet("sizeConstraintSetResource", {
        name: "string",
        sizeConstraints: [{
            comparisonOperator: "string",
            fieldToMatch: {
                type: "string",
                data: "string",
            },
            size: 0,
            textTransformation: "string",
        }],
    });
    
    type: aws:waf:SizeConstraintSet
    properties:
        name: string
        sizeConstraints:
            - comparisonOperator: string
              fieldToMatch:
                data: string
                type: string
              size: 0
              textTransformation: string
    

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

    Name string
    Name or description of the Size Constraint Set.
    SizeConstraints List<SizeConstraintSetSizeConstraint>
    Parts of web requests that you want to inspect the size of.
    Name string
    Name or description of the Size Constraint Set.
    SizeConstraints []SizeConstraintSetSizeConstraintArgs
    Parts of web requests that you want to inspect the size of.
    name String
    Name or description of the Size Constraint Set.
    sizeConstraints List<SizeConstraintSetSizeConstraint>
    Parts of web requests that you want to inspect the size of.
    name string
    Name or description of the Size Constraint Set.
    sizeConstraints SizeConstraintSetSizeConstraint[]
    Parts of web requests that you want to inspect the size of.
    name str
    Name or description of the Size Constraint Set.
    size_constraints Sequence[SizeConstraintSetSizeConstraintArgs]
    Parts of web requests that you want to inspect the size of.
    name String
    Name or description of the Size Constraint Set.
    sizeConstraints List<Property Map>
    Parts of web requests that you want to inspect the size of.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SizeConstraintSet 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 SizeConstraintSet Resource

    Get an existing SizeConstraintSet 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?: SizeConstraintSetState, opts?: CustomResourceOptions): SizeConstraintSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            name: Optional[str] = None,
            size_constraints: Optional[Sequence[SizeConstraintSetSizeConstraintArgs]] = None) -> SizeConstraintSet
    func GetSizeConstraintSet(ctx *Context, name string, id IDInput, state *SizeConstraintSetState, opts ...ResourceOption) (*SizeConstraintSet, error)
    public static SizeConstraintSet Get(string name, Input<string> id, SizeConstraintSetState? state, CustomResourceOptions? opts = null)
    public static SizeConstraintSet get(String name, Output<String> id, SizeConstraintSetState 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
    Name or description of the Size Constraint Set.
    SizeConstraints List<SizeConstraintSetSizeConstraint>
    Parts of web requests that you want to inspect the size of.
    Arn string
    Amazon Resource Name (ARN).
    Name string
    Name or description of the Size Constraint Set.
    SizeConstraints []SizeConstraintSetSizeConstraintArgs
    Parts of web requests that you want to inspect the size of.
    arn String
    Amazon Resource Name (ARN).
    name String
    Name or description of the Size Constraint Set.
    sizeConstraints List<SizeConstraintSetSizeConstraint>
    Parts of web requests that you want to inspect the size of.
    arn string
    Amazon Resource Name (ARN).
    name string
    Name or description of the Size Constraint Set.
    sizeConstraints SizeConstraintSetSizeConstraint[]
    Parts of web requests that you want to inspect the size of.
    arn str
    Amazon Resource Name (ARN).
    name str
    Name or description of the Size Constraint Set.
    size_constraints Sequence[SizeConstraintSetSizeConstraintArgs]
    Parts of web requests that you want to inspect the size of.
    arn String
    Amazon Resource Name (ARN).
    name String
    Name or description of the Size Constraint Set.
    sizeConstraints List<Property Map>
    Parts of web requests that you want to inspect the size of.

    Supporting Types

    SizeConstraintSetSizeConstraint, SizeConstraintSetSizeConstraintArgs

    ComparisonOperator string
    Type of comparison you want to perform, such as EQ, NE, LT, or GT. Please refer to the documentation for a complete list of supported values.
    FieldToMatch SizeConstraintSetSizeConstraintFieldToMatch
    Parameter that specifies where in a web request to look for the size constraint.
    Size int
    Size in bytes that you want to compare against the size of the specified field_to_match. Valid values for size are between 0 and 21474836480 bytes (0 and 20 GB).
    TextTransformation string
    Parameter is used to eliminate unusual formatting that attackers may use in web requests to bypass AWS WAF. When a transformation is specified, AWS WAF performs the transformation on the field_to_match before inspecting the request for a match. Some examples of supported transformations are CMD_LINE, HTML_ENTITY_DECODE, and NONE. You can find a complete list of supported values in the AWS WAF API Reference. Note: If you choose BODY as the type, you must also choose NONE because CloudFront only forwards the first 8192 bytes for inspection.
    ComparisonOperator string
    Type of comparison you want to perform, such as EQ, NE, LT, or GT. Please refer to the documentation for a complete list of supported values.
    FieldToMatch SizeConstraintSetSizeConstraintFieldToMatch
    Parameter that specifies where in a web request to look for the size constraint.
    Size int
    Size in bytes that you want to compare against the size of the specified field_to_match. Valid values for size are between 0 and 21474836480 bytes (0 and 20 GB).
    TextTransformation string
    Parameter is used to eliminate unusual formatting that attackers may use in web requests to bypass AWS WAF. When a transformation is specified, AWS WAF performs the transformation on the field_to_match before inspecting the request for a match. Some examples of supported transformations are CMD_LINE, HTML_ENTITY_DECODE, and NONE. You can find a complete list of supported values in the AWS WAF API Reference. Note: If you choose BODY as the type, you must also choose NONE because CloudFront only forwards the first 8192 bytes for inspection.
    comparisonOperator String
    Type of comparison you want to perform, such as EQ, NE, LT, or GT. Please refer to the documentation for a complete list of supported values.
    fieldToMatch SizeConstraintSetSizeConstraintFieldToMatch
    Parameter that specifies where in a web request to look for the size constraint.
    size Integer
    Size in bytes that you want to compare against the size of the specified field_to_match. Valid values for size are between 0 and 21474836480 bytes (0 and 20 GB).
    textTransformation String
    Parameter is used to eliminate unusual formatting that attackers may use in web requests to bypass AWS WAF. When a transformation is specified, AWS WAF performs the transformation on the field_to_match before inspecting the request for a match. Some examples of supported transformations are CMD_LINE, HTML_ENTITY_DECODE, and NONE. You can find a complete list of supported values in the AWS WAF API Reference. Note: If you choose BODY as the type, you must also choose NONE because CloudFront only forwards the first 8192 bytes for inspection.
    comparisonOperator string
    Type of comparison you want to perform, such as EQ, NE, LT, or GT. Please refer to the documentation for a complete list of supported values.
    fieldToMatch SizeConstraintSetSizeConstraintFieldToMatch
    Parameter that specifies where in a web request to look for the size constraint.
    size number
    Size in bytes that you want to compare against the size of the specified field_to_match. Valid values for size are between 0 and 21474836480 bytes (0 and 20 GB).
    textTransformation string
    Parameter is used to eliminate unusual formatting that attackers may use in web requests to bypass AWS WAF. When a transformation is specified, AWS WAF performs the transformation on the field_to_match before inspecting the request for a match. Some examples of supported transformations are CMD_LINE, HTML_ENTITY_DECODE, and NONE. You can find a complete list of supported values in the AWS WAF API Reference. Note: If you choose BODY as the type, you must also choose NONE because CloudFront only forwards the first 8192 bytes for inspection.
    comparison_operator str
    Type of comparison you want to perform, such as EQ, NE, LT, or GT. Please refer to the documentation for a complete list of supported values.
    field_to_match SizeConstraintSetSizeConstraintFieldToMatch
    Parameter that specifies where in a web request to look for the size constraint.
    size int
    Size in bytes that you want to compare against the size of the specified field_to_match. Valid values for size are between 0 and 21474836480 bytes (0 and 20 GB).
    text_transformation str
    Parameter is used to eliminate unusual formatting that attackers may use in web requests to bypass AWS WAF. When a transformation is specified, AWS WAF performs the transformation on the field_to_match before inspecting the request for a match. Some examples of supported transformations are CMD_LINE, HTML_ENTITY_DECODE, and NONE. You can find a complete list of supported values in the AWS WAF API Reference. Note: If you choose BODY as the type, you must also choose NONE because CloudFront only forwards the first 8192 bytes for inspection.
    comparisonOperator String
    Type of comparison you want to perform, such as EQ, NE, LT, or GT. Please refer to the documentation for a complete list of supported values.
    fieldToMatch Property Map
    Parameter that specifies where in a web request to look for the size constraint.
    size Number
    Size in bytes that you want to compare against the size of the specified field_to_match. Valid values for size are between 0 and 21474836480 bytes (0 and 20 GB).
    textTransformation String
    Parameter is used to eliminate unusual formatting that attackers may use in web requests to bypass AWS WAF. When a transformation is specified, AWS WAF performs the transformation on the field_to_match before inspecting the request for a match. Some examples of supported transformations are CMD_LINE, HTML_ENTITY_DECODE, and NONE. You can find a complete list of supported values in the AWS WAF API Reference. Note: If you choose BODY as the type, you must also choose NONE because CloudFront only forwards the first 8192 bytes for inspection.

    SizeConstraintSetSizeConstraintFieldToMatch, SizeConstraintSetSizeConstraintFieldToMatchArgs

    Type string
    Part of the web request that you want AWS WAF to search for a specified string. For example, HEADER, METHOD, or BODY. See the docs for all supported values.
    Data string
    When the type is HEADER, specify the name of the header that you want to search using the data field, for example, User-Agent or Referer. If the type is any other value, you can omit this field.
    Type string
    Part of the web request that you want AWS WAF to search for a specified string. For example, HEADER, METHOD, or BODY. See the docs for all supported values.
    Data string
    When the type is HEADER, specify the name of the header that you want to search using the data field, for example, User-Agent or Referer. If the type is any other value, you can omit this field.
    type String
    Part of the web request that you want AWS WAF to search for a specified string. For example, HEADER, METHOD, or BODY. See the docs for all supported values.
    data String
    When the type is HEADER, specify the name of the header that you want to search using the data field, for example, User-Agent or Referer. If the type is any other value, you can omit this field.
    type string
    Part of the web request that you want AWS WAF to search for a specified string. For example, HEADER, METHOD, or BODY. See the docs for all supported values.
    data string
    When the type is HEADER, specify the name of the header that you want to search using the data field, for example, User-Agent or Referer. If the type is any other value, you can omit this field.
    type str
    Part of the web request that you want AWS WAF to search for a specified string. For example, HEADER, METHOD, or BODY. See the docs for all supported values.
    data str
    When the type is HEADER, specify the name of the header that you want to search using the data field, for example, User-Agent or Referer. If the type is any other value, you can omit this field.
    type String
    Part of the web request that you want AWS WAF to search for a specified string. For example, HEADER, METHOD, or BODY. See the docs for all supported values.
    data String
    When the type is HEADER, specify the name of the header that you want to search using the data field, for example, User-Agent or Referer. If the type is any other value, you can omit this field.

    Import

    Using pulumi import, import AWS WAF Size Constraint Set using their ID. For example:

    $ pulumi import aws:waf/sizeConstraintSet:SizeConstraintSet example 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.32.0 published on Friday, Apr 19, 2024 by Pulumi