Class CfnWebACL.RuleActionOverrideProperty
Action setting to use in the place of a rule action that is configured inside the rule group.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.WAFv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class RuleActionOverrideProperty : Object, CfnWebACL.IRuleActionOverrideProperty
Syntax (vb)
Public Class RuleActionOverrideProperty
Inherits Object
Implements CfnWebACL.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
Constructors
RuleActionOverrideProperty() |
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. |
Constructors
RuleActionOverrideProperty()
public RuleActionOverrideProperty()
Properties
ActionToUse
The override action to use, in place of the configured action of the rule in the rule group.
public object ActionToUse { get; set; }
Property Value
System.Object
Remarks
Name
The name of the rule to override.
public string Name { get; set; }
Property Value
System.String