aws-cdk-lib.aws_wafv2.CfnWebACL.RuleActionOverrideProperty

interface RuleActionOverrideProperty

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

Action setting to use in the place of a rule action that is configured inside the rule group.

You specify one override for each rule whose action you want to change.

You can use overrides for testing, for example you can override all of rule actions to Count and then monitor the resulting count metrics to understand how the rule group would handle your web traffic. You can also permanently override some or all actions, to modify how the rule group manages your web traffic.

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 ruleActionOverrideProperty: wafv2.CfnWebACL.RuleActionOverrideProperty = {
  actionToUse: {
    allow: {
      customRequestHandling: {
        insertHeaders: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
    block: {
      customResponse: {
        responseCode: 123,

        // the properties below are optional
        customResponseBodyKey: 'customResponseBodyKey',
        responseHeaders: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
    captcha: {
      customRequestHandling: {
        insertHeaders: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
    challenge: {
      customRequestHandling: {
        insertHeaders: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
    count: {
      customRequestHandling: {
        insertHeaders: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
  },
  name: 'name',
};

Properties

NameTypeDescription
actionToUseIResolvable | RuleActionPropertyThe override action to use, in place of the configured action of the rule in the rule group.
namestringThe name of the rule to override.

actionToUse

Type: IResolvable | RuleActionProperty

The override action to use, in place of the configured action of the rule in the rule group.


name

Type: string

The name of the rule to override.