aws-cdk-lib.aws_wafv2.CfnWebACL.DefaultActionProperty

interface DefaultActionProperty

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

In a WebACL , this is the action that you want AWS WAF to perform when a web request doesn't match any of the rules in the WebACL .

The default action must be a terminating 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 defaultActionProperty: wafv2.CfnWebACL.DefaultActionProperty = {
  allow: {
    customRequestHandling: {
      insertHeaders: [{
        name: 'name',
        value: 'value',
      }],
    },
  },
  block: {
    customResponse: {
      responseCode: 123,

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

Properties

NameTypeDescription
allow?IResolvable | AllowActionPropertySpecifies that AWS WAF should allow requests by default.
block?IResolvable | BlockActionPropertySpecifies that AWS WAF should block requests by default.

allow?

Type: IResolvable | AllowActionProperty (optional)

Specifies that AWS WAF should allow requests by default.


block?

Type: IResolvable | BlockActionProperty (optional)

Specifies that AWS WAF should block requests by default.