Interface CfnWebACL.IRuleActionOverrideProperty
Action setting to use in the place of a rule action that is configured inside the rule group.
Namespace: Amazon.CDK.AWS.WAFv2
Assembly: Amazon.CDK.AWS.WAFv2.dll
Syntax (csharp)
public interface IRuleActionOverrideProperty
Syntax (vb)
Public Interface IRuleActionOverrideProperty
Remarks
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.
ExampleMetadata: fixture=_generated
Examples
// 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 ruleActionOverrideProperty = new RuleActionOverrideProperty {
ActionToUse = new RuleActionProperty {
Allow = new AllowActionProperty {
CustomRequestHandling = new CustomRequestHandlingProperty {
InsertHeaders = new [] { new CustomHTTPHeaderProperty {
Name = "name",
Value = "value"
} }
}
},
Block = new BlockActionProperty {
CustomResponse = new CustomResponseProperty {
ResponseCode = 123,
// the properties below are optional
CustomResponseBodyKey = "customResponseBodyKey",
ResponseHeaders = new [] { new CustomHTTPHeaderProperty {
Name = "name",
Value = "value"
} }
}
},
Captcha = new CaptchaActionProperty {
CustomRequestHandling = new CustomRequestHandlingProperty {
InsertHeaders = new [] { new CustomHTTPHeaderProperty {
Name = "name",
Value = "value"
} }
}
},
Challenge = new ChallengeActionProperty {
CustomRequestHandling = new CustomRequestHandlingProperty {
InsertHeaders = new [] { new CustomHTTPHeaderProperty {
Name = "name",
Value = "value"
} }
}
},
Count = new CountActionProperty {
CustomRequestHandling = new CustomRequestHandlingProperty {
InsertHeaders = new [] { new CustomHTTPHeaderProperty {
Name = "name",
Value = "value"
} }
}
}
},
Name = "name"
};
Synopsis
Properties
ActionToUse | The override action to use, in place of the configured action of the rule in the rule group. |
Name | The name of the rule to override. |
Properties
ActionToUse
The override action to use, in place of the configured action of the rule in the rule group.
object ActionToUse { get; }
Property Value
System.Object
Remarks
Name
The name of the rule to override.
string Name { get; }
Property Value
System.String