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
Constructors -
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 aCAPTCHAcheck against the request:.- If the request includes a valid, unexpired
CAPTCHAtoken, 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
CAPTCHAtoken, 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-actionwith a value ofcaptcha. - The HTTP status code
405 Method Not Allowed. - If the request contains an
Acceptheader with a value oftext/html, the response includes aCAPTCHAchallenge.
You can configure the expiration time in the
CaptchaConfigImmunityTimePropertysetting 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 aChallengecheck 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:
buildin interfacesoftware.amazon.jsii.Builder<CfnRuleGroup.RuleActionProperty>- Returns:
- a new instance of
CfnRuleGroup.RuleActionProperty - Throws:
NullPointerException- if any required attribute was not provided
-