Skip to content
v2.278.0

CustomRequestHandlingProperty Struct ​

Custom request handling behavior that inserts custom headers into a web request.

You can add custom request handling for AWS WAF to use when the rule action doesn't block the request. For example, CaptchaAction for requests with valid t okens, and AllowAction .

For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_wafv2 as wafv2 } from 'aws-cdk-lib';
const customRequestHandlingProperty: wafv2.CfnRuleGroup.CustomRequestHandlingProperty = {
  insertHeaders: [{
    name: 'name',
    value: 'value',
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_wafv2 as wafv2

custom_request_handling_property = wafv2.CfnRuleGroup.CustomRequestHandlingProperty(
    insert_headers=[wafv2.CfnRuleGroup.CustomHTTPHeaderProperty(
        name="name",
        value="value"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.wafv2.*;

CustomRequestHandlingProperty customRequestHandlingProperty = CustomRequestHandlingProperty.builder()
        .insertHeaders(List.of(CustomHTTPHeaderProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.WAFv2;

var customRequestHandlingProperty = new CustomRequestHandlingProperty {
    InsertHeaders = new [] { new CustomHTTPHeaderProperty {
        Name = "name",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customRequestHandlingProperty := &CustomRequestHandlingProperty{
	InsertHeaders: []interface{}{
		&CustomHTTPHeaderProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

insertHeadersIResolvable | IResolvable | CfnRuleGroup.CustomHTTPHeaderProperty[]insert_headerstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CustomHTTPHeaderProperty]]]insertHeadersIResolvableInsertHeadersIResolvableInsertHeadersinterface{} required #
The HTTP headers to insert into the request. Duplicate header names are not allowed.

For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .