1. Packages
  2. AWS
  3. API Docs
  4. wafregional
  5. SizeConstraintSet
AWS v6.74.0 published on Wednesday, Mar 26, 2025 by Pulumi

aws.wafregional.SizeConstraintSet

Explore with Pulumi AI

Provides a WAF Regional Size Constraint Set Resource for use with Application Load Balancer.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const sizeConstraintSet = new aws.wafregional.SizeConstraintSet("size_constraint_set", {
    name: "tfsize_constraints",
    sizeConstraints: [{
        textTransformation: "NONE",
        comparisonOperator: "EQ",
        size: 4096,
        fieldToMatch: {
            type: "BODY",
        },
    }],
});
Copy
import pulumi
import pulumi_aws as aws

size_constraint_set = aws.wafregional.SizeConstraintSet("size_constraint_set",
    name="tfsize_constraints",
    size_constraints=[{
        "text_transformation": "NONE",
        "comparison_operator": "EQ",
        "size": 4096,
        "field_to_match": {
            "type": "BODY",
        },
    }])
Copy
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.NewSizeConstraintSet(ctx, "size_constraint_set", &wafregional.SizeConstraintSetArgs{
			Name: pulumi.String("tfsize_constraints"),
			SizeConstraints: wafregional.SizeConstraintSetSizeConstraintArray{
				&wafregional.SizeConstraintSetSizeConstraintArgs{
					TextTransformation: pulumi.String("NONE"),
					ComparisonOperator: pulumi.String("EQ"),
					Size:               pulumi.Int(4096),
					FieldToMatch: &wafregional.SizeConstraintSetSizeConstraintFieldToMatchArgs{
						Type: pulumi.String("BODY"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var sizeConstraintSet = new Aws.WafRegional.SizeConstraintSet("size_constraint_set", new()
    {
        Name = "tfsize_constraints",
        SizeConstraints = new[]
        {
            new Aws.WafRegional.Inputs.SizeConstraintSetSizeConstraintArgs
            {
                TextTransformation = "NONE",
                ComparisonOperator = "EQ",
                Size = 4096,
                FieldToMatch = new Aws.WafRegional.Inputs.SizeConstraintSetSizeConstraintFieldToMatchArgs
                {
                    Type = "BODY",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.wafregional.SizeConstraintSet;
import com.pulumi.aws.wafregional.SizeConstraintSetArgs;
import com.pulumi.aws.wafregional.inputs.SizeConstraintSetSizeConstraintArgs;
import com.pulumi.aws.wafregional.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());

    }
}
Copy
resources:
  sizeConstraintSet:
    type: aws:wafregional:SizeConstraintSet
    name: size_constraint_set
    properties:
      name: tfsize_constraints
      sizeConstraints:
        - textTransformation: NONE
          comparisonOperator: EQ
          size: '4096'
          fieldToMatch:
            type: BODY
Copy

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:wafregional:SizeConstraintSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. SizeConstraintSetArgs
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 awsSizeConstraintSetResource = new Aws.WafRegional.SizeConstraintSet("awsSizeConstraintSetResource", new()
{
    Name = "string",
    SizeConstraints = new[]
    {
        new Aws.WafRegional.Inputs.SizeConstraintSetSizeConstraintArgs
        {
            ComparisonOperator = "string",
            FieldToMatch = new Aws.WafRegional.Inputs.SizeConstraintSetSizeConstraintFieldToMatchArgs
            {
                Type = "string",
                Data = "string",
            },
            Size = 0,
            TextTransformation = "string",
        },
    },
});
Copy
example, err := wafregional.NewSizeConstraintSet(ctx, "awsSizeConstraintSetResource", &wafregional.SizeConstraintSetArgs{
	Name: pulumi.String("string"),
	SizeConstraints: wafregional.SizeConstraintSetSizeConstraintArray{
		&wafregional.SizeConstraintSetSizeConstraintArgs{
			ComparisonOperator: pulumi.String("string"),
			FieldToMatch: &wafregional.SizeConstraintSetSizeConstraintFieldToMatchArgs{
				Type: pulumi.String("string"),
				Data: pulumi.String("string"),
			},
			Size:               pulumi.Int(0),
			TextTransformation: pulumi.String("string"),
		},
	},
})
Copy
var awsSizeConstraintSetResource = new SizeConstraintSet("awsSizeConstraintSetResource", SizeConstraintSetArgs.builder()
    .name("string")
    .sizeConstraints(SizeConstraintSetSizeConstraintArgs.builder()
        .comparisonOperator("string")
        .fieldToMatch(SizeConstraintSetSizeConstraintFieldToMatchArgs.builder()
            .type("string")
            .data("string")
            .build())
        .size(0)
        .textTransformation("string")
        .build())
    .build());
Copy
aws_size_constraint_set_resource = aws.wafregional.SizeConstraintSet("awsSizeConstraintSetResource",
    name="string",
    size_constraints=[{
        "comparison_operator": "string",
        "field_to_match": {
            "type": "string",
            "data": "string",
        },
        "size": 0,
        "text_transformation": "string",
    }])
Copy
const awsSizeConstraintSetResource = new aws.wafregional.SizeConstraintSet("awsSizeConstraintSetResource", {
    name: "string",
    sizeConstraints: [{
        comparisonOperator: "string",
        fieldToMatch: {
            type: "string",
            data: "string",
        },
        size: 0,
        textTransformation: "string",
    }],
});
Copy
type: aws:wafregional:SizeConstraintSet
properties:
    name: string
    sizeConstraints:
        - comparisonOperator: string
          fieldToMatch:
            data: string
            type: string
          size: 0
          textTransformation: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SizeConstraintSet resource accepts the following input properties:

Name Changes to this property will trigger replacement. string
The name or description of the Size Constraint Set.
SizeConstraints List<SizeConstraintSetSizeConstraint>
Specifies the parts of web requests that you want to inspect the size of.
Name Changes to this property will trigger replacement. string
The name or description of the Size Constraint Set.
SizeConstraints []SizeConstraintSetSizeConstraintArgs
Specifies the parts of web requests that you want to inspect the size of.
name Changes to this property will trigger replacement. String
The name or description of the Size Constraint Set.
sizeConstraints List<SizeConstraintSetSizeConstraint>
Specifies the parts of web requests that you want to inspect the size of.
name Changes to this property will trigger replacement. string
The name or description of the Size Constraint Set.
sizeConstraints SizeConstraintSetSizeConstraint[]
Specifies the parts of web requests that you want to inspect the size of.
name Changes to this property will trigger replacement. str
The name or description of the Size Constraint Set.
size_constraints Sequence[SizeConstraintSetSizeConstraintArgs]
Specifies the parts of web requests that you want to inspect the size of.
name Changes to this property will trigger replacement. String
The name or description of the Size Constraint Set.
sizeConstraints List<Property Map>
Specifies the 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
Id string
The provider-assigned unique ID for this managed resource.
Arn string
Id string
The provider-assigned unique ID for this managed resource.
arn String
id String
The provider-assigned unique ID for this managed resource.
arn string
id string
The provider-assigned unique ID for this managed resource.
arn str
id str
The provider-assigned unique ID for this managed resource.
arn String
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)
resources:  _:    type: aws:wafregional:SizeConstraintSet    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Name Changes to this property will trigger replacement. string
The name or description of the Size Constraint Set.
SizeConstraints List<SizeConstraintSetSizeConstraint>
Specifies the parts of web requests that you want to inspect the size of.
Arn string
Name Changes to this property will trigger replacement. string
The name or description of the Size Constraint Set.
SizeConstraints []SizeConstraintSetSizeConstraintArgs
Specifies the parts of web requests that you want to inspect the size of.
arn String
name Changes to this property will trigger replacement. String
The name or description of the Size Constraint Set.
sizeConstraints List<SizeConstraintSetSizeConstraint>
Specifies the parts of web requests that you want to inspect the size of.
arn string
name Changes to this property will trigger replacement. string
The name or description of the Size Constraint Set.
sizeConstraints SizeConstraintSetSizeConstraint[]
Specifies the parts of web requests that you want to inspect the size of.
arn str
name Changes to this property will trigger replacement. str
The name or description of the Size Constraint Set.
size_constraints Sequence[SizeConstraintSetSizeConstraintArgs]
Specifies the parts of web requests that you want to inspect the size of.
arn String
name Changes to this property will trigger replacement. String
The name or description of the Size Constraint Set.
sizeConstraints List<Property Map>
Specifies the parts of web requests that you want to inspect the size of.

Supporting Types

SizeConstraintSetSizeConstraint
, SizeConstraintSetSizeConstraintArgs

ComparisonOperator This property is required. string
The type of comparison you want to perform. e.g., EQ, NE, LT, GT. See docs for all supported values.
FieldToMatch This property is required. SizeConstraintSetSizeConstraintFieldToMatch
Specifies where in a web request to look for the size constraint.
Size This property is required. int
The size in bytes that you want to compare against the size of the specified field_to_match. Valid values are between 0 - 21474836480 bytes (0 - 20 GB).
TextTransformation This property is required. 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 field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values. Note: if you choose BODY as type, you must choose NONE because CloudFront forwards only the first 8192 bytes for inspection.
ComparisonOperator This property is required. string
The type of comparison you want to perform. e.g., EQ, NE, LT, GT. See docs for all supported values.
FieldToMatch This property is required. SizeConstraintSetSizeConstraintFieldToMatch
Specifies where in a web request to look for the size constraint.
Size This property is required. int
The size in bytes that you want to compare against the size of the specified field_to_match. Valid values are between 0 - 21474836480 bytes (0 - 20 GB).
TextTransformation This property is required. 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 field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values. Note: if you choose BODY as type, you must choose NONE because CloudFront forwards only the first 8192 bytes for inspection.
comparisonOperator This property is required. String
The type of comparison you want to perform. e.g., EQ, NE, LT, GT. See docs for all supported values.
fieldToMatch This property is required. SizeConstraintSetSizeConstraintFieldToMatch
Specifies where in a web request to look for the size constraint.
size This property is required. Integer
The size in bytes that you want to compare against the size of the specified field_to_match. Valid values are between 0 - 21474836480 bytes (0 - 20 GB).
textTransformation This property is required. 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 field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values. Note: if you choose BODY as type, you must choose NONE because CloudFront forwards only the first 8192 bytes for inspection.
comparisonOperator This property is required. string
The type of comparison you want to perform. e.g., EQ, NE, LT, GT. See docs for all supported values.
fieldToMatch This property is required. SizeConstraintSetSizeConstraintFieldToMatch
Specifies where in a web request to look for the size constraint.
size This property is required. number
The size in bytes that you want to compare against the size of the specified field_to_match. Valid values are between 0 - 21474836480 bytes (0 - 20 GB).
textTransformation This property is required. 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 field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values. Note: if you choose BODY as type, you must choose NONE because CloudFront forwards only the first 8192 bytes for inspection.
comparison_operator This property is required. str
The type of comparison you want to perform. e.g., EQ, NE, LT, GT. See docs for all supported values.
field_to_match This property is required. SizeConstraintSetSizeConstraintFieldToMatch
Specifies where in a web request to look for the size constraint.
size This property is required. int
The size in bytes that you want to compare against the size of the specified field_to_match. Valid values are between 0 - 21474836480 bytes (0 - 20 GB).
text_transformation This property is required. 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 field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values. Note: if you choose BODY as type, you must choose NONE because CloudFront forwards only the first 8192 bytes for inspection.
comparisonOperator This property is required. String
The type of comparison you want to perform. e.g., EQ, NE, LT, GT. See docs for all supported values.
fieldToMatch This property is required. Property Map
Specifies where in a web request to look for the size constraint.
size This property is required. Number
The size in bytes that you want to compare against the size of the specified field_to_match. Valid values are between 0 - 21474836480 bytes (0 - 20 GB).
textTransformation This property is required. 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 field_to_match before inspecting a request for a match. e.g., CMD_LINE, HTML_ENTITY_DECODE or NONE. See docs for all supported values. Note: if you choose BODY as type, you must choose NONE because CloudFront forwards only the first 8192 bytes for inspection.

SizeConstraintSetSizeConstraintFieldToMatch
, SizeConstraintSetSizeConstraintFieldToMatchArgs

Type This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 Size Constraint Set using the id. For example:

$ pulumi import aws:wafregional/sizeConstraintSet:SizeConstraintSet size_constraint_set a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
Copy

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.