Class CfnRuleGroup.RuleActionProperty.Builder
java.lang.Object
software.amazon.awscdk.services.wafv2.CfnRuleGroup.RuleActionProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnRuleGroup.RuleActionProperty>
- Enclosing interface:
- CfnRuleGroup.RuleActionProperty
@Stability(Stable)
public static final class CfnRuleGroup.RuleActionProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnRuleGroup.RuleActionProperty>
A builder for
CfnRuleGroup.RuleActionProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCfnRuleGroup.RuleActionProperty.getAllow()
Sets the value ofCfnRuleGroup.RuleActionProperty.getBlock()
build()
Builds the configured instance.Sets the value ofCfnRuleGroup.RuleActionProperty.getCaptcha()
Sets the value ofCfnRuleGroup.RuleActionProperty.getChallenge()
Sets the value ofCfnRuleGroup.RuleActionProperty.getCount()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allow
Sets the value ofCfnRuleGroup.RuleActionProperty.getAllow()
- Parameters:
allow
- Instructs AWS WAF to allow the web request.- Returns:
this
-
block
Sets the value ofCfnRuleGroup.RuleActionProperty.getBlock()
- Parameters:
block
- Instructs AWS WAF to block the web request.- Returns:
this
-
captcha
Sets the value ofCfnRuleGroup.RuleActionProperty.getCaptcha()
- Parameters:
captcha
- Specifies that AWS WAF should run aCAPTCHA
check against the request:.- If the request includes a valid, unexpired
CAPTCHA
token, AWS WAF allows the web request inspection to proceed to the next rule, similar to aCountAction
. - If the request doesn't include a valid, unexpired
CAPTCHA
token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
AWS WAF generates a response that it sends back to the client, which includes the following:
- The header
x-amzn-waf-action
with a value ofcaptcha
. - The HTTP status code
405 Method Not Allowed
. - If the request contains an
Accept
header with a value oftext/html
, the response includes aCAPTCHA
challenge.
You can configure the expiration time in the
CaptchaConfig
ImmunityTimeProperty
setting at the rule and web ACL level. The rule setting overrides the web ACL setting.This action option is available for rules. It isn't available for web ACL default actions.
- If the request includes a valid, unexpired
- Returns:
this
-
challenge
Sets the value ofCfnRuleGroup.RuleActionProperty.getChallenge()
- Parameters:
challenge
- Instructs AWS WAF to run aChallenge
check against the web request.- Returns:
this
-
count
Sets the value ofCfnRuleGroup.RuleActionProperty.getCount()
- Parameters:
count
- Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnRuleGroup.RuleActionProperty>
- Returns:
- a new instance of
CfnRuleGroup.RuleActionProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-