aws-cdk-lib.aws_wafv2.CfnWebACL.BlockActionProperty

interface BlockActionProperty

LanguageType name
.NETAmazon.CDK.AWS.WAFv2.CfnWebACL.BlockActionProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awswafv2#CfnWebACL_BlockActionProperty
Javasoftware.amazon.awscdk.services.wafv2.CfnWebACL.BlockActionProperty
Pythonaws_cdk.aws_wafv2.CfnWebACL.BlockActionProperty
TypeScript aws-cdk-lib » aws_wafv2 » CfnWebACL » BlockActionProperty

Specifies that AWS WAF should block the request and optionally defines additional custom handling for the response to the web request.

This is used in the context of other settings, for example to specify values for a rule action or a web ACL default action.

Example

// 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 blockActionProperty: wafv2.CfnWebACL.BlockActionProperty = {
  customResponse: {
    responseCode: 123,

    // the properties below are optional
    customResponseBodyKey: 'customResponseBodyKey',
    responseHeaders: [{
      name: 'name',
      value: 'value',
    }],
  },
};

Properties

NameTypeDescription
customResponse?IResolvable | CustomResponsePropertyDefines a custom response for the web request.

customResponse?

Type: IResolvable | CustomResponseProperty (optional)

Defines a custom response for the web request.

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