AWS WAF Size Constraint Set
This page shows how to write Terraform and CloudFormation for AWS WAF Size Constraint Set and write them securely.
aws_waf_size_constraint_set (Terraform)
The Size Constraint Set in AWS WAF can be configured in Terraform with the resource name aws_waf_size_constraint_set
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_waf_size_constraint_set" "main" {
name = var.name
size_constraints {
text_transformation = var.text_transformation
comparison_operator = var.comparison_operator
resource "aws_waf_size_constraint_set" "this" {
name = var.name
dynamic "size_constraints" {
for_each = var.size_constraints
content {
Parameters
-
arn
optional computed - string -
id
optional computed - string -
name
required - string -
size_constraints
set block-
comparison_operator
required - string -
size
required - number -
text_transformation
required - string -
field_to_match
list block
-
Explanation in Terraform Registry
Provides a WAF Size Constraint Set Resource
AWS::WAF::SizeConstraintSet (CloudFormation)
The SizeConstraintSet in WAF can be configured in CloudFormation with the resource name AWS::WAF::SizeConstraintSet
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::WAF::SizeConstraintSet
Condition: isGlobal
Properties:
Name: !Join ['-', [!Ref stackPrefix, 'size-restrictions']]
SizeConstraints:
- FieldToMatch:
Type: AWS::WAF::SizeConstraintSet
Condition: isGlobal
Properties:
Name: !Join ['-', [!Ref stackPrefix, 'size-restrictions']]
SizeConstraints:
- FieldToMatch:
Type: AWS::WAF::SizeConstraintSet
Condition: isGlobal
Properties:
Name: !Join ['-', [!Ref stackPrefix, 'size-restrictions']]
SizeConstraints:
- FieldToMatch:
Type: 'AWS::WAF::SizeConstraintSet'
SqliMatchSet:
Properties:
Name: !Join
- ''
- - !Ref WebAppACL
Type: 'AWS::WAF::SizeConstraintSet'
SqliMatchSet:
Properties:
Name: !Join
- ''
- - !Ref WebAppACL
"Type": "AWS::WAF::SizeConstraintSet",
"Properties": {
"Name": {
"Ref": "SizeCondition1"
},
"SizeConstraints": [
"AWS::WAF::SizeConstraintSet.FieldToMatch": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waf-sizeconstraintset-sizeconstraint-fieldtomatch.html",
"Properties": {
"Data": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waf-sizeconstraintset-sizeconstraint-fieldtomatch.html#cfn-waf-sizeconstraintset-sizeconstraint-fieldtomatch-data",
"PrimitiveType": "String",
"AWS::WAF::SizeConstraintSet.FieldToMatch": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waf-sizeconstraintset-sizeconstraint-fieldtomatch.html",
"Properties": {
"Data": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waf-sizeconstraintset-sizeconstraint-fieldtomatch.html#cfn-waf-sizeconstraintset-sizeconstraint-fieldtomatch-data",
"PrimitiveType": "String",
"AWS::WAF::SizeConstraintSet.FieldToMatch": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waf-sizeconstraintset-sizeconstraint-fieldtomatch.html",
"Properties": {
"Data": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waf-sizeconstraintset-sizeconstraint-fieldtomatch.html#cfn-waf-sizeconstraintset-sizeconstraint-fieldtomatch-data",
"PrimitiveType": "String",
"resourceType" : "AWS::WAF::SizeConstraintSet",
"properties" : [ {
"propertyName" : "Name",
"propertyType" : "String",
"required" : true
}, {
Parameters
-
Name
required - String -
SizeConstraints
required - List of SizeConstraint
Explanation in CloudFormation Registry
Note This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF , use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. A complex type that contains
SizeConstraint
objects, which specify the parts of web requests that you want AWS WAF to inspect the size of. If aSizeConstraintSet
contains more than oneSizeConstraint
object, a request only needs to match one constraint to be considered a match.
Frequently asked questions
What is AWS WAF Size Constraint Set?
AWS WAF Size Constraint Set is a resource for WAF of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS WAF Size Constraint Set?
For Terraform, the boldlink/terraform and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the Amish132/Cloud-AWS--Fault-Tolerant-Notes-Application, gaurangdavda/CloudNote and TeliaSoneraNorge/telia-terraform-modules source code examples are useful. See the CloudFormation Example section for further details.