Class CfnWebACL.RuleProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnWebACL.RuleProperty>
- Enclosing interface:
CfnWebACL.RuleProperty
CfnWebACL.RuleProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaction
(IResolvable action) Sets the value ofCfnWebACL.RuleProperty.getAction()
action
(CfnWebACL.RuleActionProperty action) Sets the value ofCfnWebACL.RuleProperty.getAction()
build()
Builds the configured instance.captchaConfig
(IResolvable captchaConfig) Sets the value ofCfnWebACL.RuleProperty.getCaptchaConfig()
captchaConfig
(CfnWebACL.CaptchaConfigProperty captchaConfig) Sets the value ofCfnWebACL.RuleProperty.getCaptchaConfig()
challengeConfig
(IResolvable challengeConfig) Sets the value ofCfnWebACL.RuleProperty.getChallengeConfig()
challengeConfig
(CfnWebACL.ChallengeConfigProperty challengeConfig) Sets the value ofCfnWebACL.RuleProperty.getChallengeConfig()
Sets the value ofCfnWebACL.RuleProperty.getName()
overrideAction
(IResolvable overrideAction) Sets the value ofCfnWebACL.RuleProperty.getOverrideAction()
overrideAction
(CfnWebACL.OverrideActionProperty overrideAction) Sets the value ofCfnWebACL.RuleProperty.getOverrideAction()
Sets the value ofCfnWebACL.RuleProperty.getPriority()
ruleLabels
(List<? extends Object> ruleLabels) Sets the value ofCfnWebACL.RuleProperty.getRuleLabels()
ruleLabels
(IResolvable ruleLabels) Sets the value ofCfnWebACL.RuleProperty.getRuleLabels()
statement
(IResolvable statement) Sets the value ofCfnWebACL.RuleProperty.getStatement()
statement
(CfnWebACL.StatementProperty statement) Sets the value ofCfnWebACL.RuleProperty.getStatement()
visibilityConfig
(IResolvable visibilityConfig) Sets the value ofCfnWebACL.RuleProperty.getVisibilityConfig()
visibilityConfig
(CfnWebACL.VisibilityConfigProperty visibilityConfig) Sets the value ofCfnWebACL.RuleProperty.getVisibilityConfig()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the value ofCfnWebACL.RuleProperty.getName()
- Parameters:
name
- The name of the rule. This parameter is required. If you change the name of aRule
after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule'sVisibilityConfig
settings. AWS WAF doesn't automatically update the metric name when you update the rule name.- Returns:
this
-
priority
Sets the value ofCfnWebACL.RuleProperty.getPriority()
- Parameters:
priority
- If you define more than oneRule
in aWebACL
, AWS WAF evaluates each request against theRules
in order based on the value ofPriority
. This parameter is required. AWS WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.- Returns:
this
-
statement
Sets the value ofCfnWebACL.RuleProperty.getStatement()
- Parameters:
statement
- The AWS WAF processing statement for the rule, for exampleByteMatchStatement
orSizeConstraintStatement
. This parameter is required.- Returns:
this
-
statement
@Stability(Stable) public CfnWebACL.RuleProperty.Builder statement(CfnWebACL.StatementProperty statement) Sets the value ofCfnWebACL.RuleProperty.getStatement()
- Parameters:
statement
- The AWS WAF processing statement for the rule, for exampleByteMatchStatement
orSizeConstraintStatement
. This parameter is required.- Returns:
this
-
visibilityConfig
@Stability(Stable) public CfnWebACL.RuleProperty.Builder visibilityConfig(IResolvable visibilityConfig) Sets the value ofCfnWebACL.RuleProperty.getVisibilityConfig()
- Parameters:
visibilityConfig
- Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required. If you change the name of aRule
after you create it and you want the rule's metric name to reflect the change, update the metric name as well. AWS WAF doesn't automatically update the metric name.- Returns:
this
-
visibilityConfig
@Stability(Stable) public CfnWebACL.RuleProperty.Builder visibilityConfig(CfnWebACL.VisibilityConfigProperty visibilityConfig) Sets the value ofCfnWebACL.RuleProperty.getVisibilityConfig()
- Parameters:
visibilityConfig
- Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required. If you change the name of aRule
after you create it and you want the rule's metric name to reflect the change, update the metric name as well. AWS WAF doesn't automatically update the metric name.- Returns:
this
-
action
Sets the value ofCfnWebACL.RuleProperty.getAction()
- Parameters:
action
- The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.This is used only for rules whose statements don't reference a rule group. Rule statements that reference a rule group are
RuleGroupReferenceStatement
andManagedRuleGroupStatement
.You must set either this
Action
setting or the rule'sOverrideAction
, but not both:- If the rule statement doesn't reference a rule group, you must set this rule action setting and you must not set the rule's override action setting.
- If the rule statement references a rule group, you must not set this action setting, because the actions are already set on the rules inside the rule group. You must set the rule's override action setting to indicate specifically whether to override the actions that are set on the rules in the rule group.
- Returns:
this
-
action
@Stability(Stable) public CfnWebACL.RuleProperty.Builder action(CfnWebACL.RuleActionProperty action) Sets the value ofCfnWebACL.RuleProperty.getAction()
- Parameters:
action
- The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.This is used only for rules whose statements don't reference a rule group. Rule statements that reference a rule group are
RuleGroupReferenceStatement
andManagedRuleGroupStatement
.You must set either this
Action
setting or the rule'sOverrideAction
, but not both:- If the rule statement doesn't reference a rule group, you must set this rule action setting and you must not set the rule's override action setting.
- If the rule statement references a rule group, you must not set this action setting, because the actions are already set on the rules inside the rule group. You must set the rule's override action setting to indicate specifically whether to override the actions that are set on the rules in the rule group.
- Returns:
this
-
captchaConfig
Sets the value ofCfnWebACL.RuleProperty.getCaptchaConfig()
- Parameters:
captchaConfig
- Specifies how AWS WAF should handleCAPTCHA
evaluations. If you don't specify this, AWS WAF uses theCAPTCHA
configuration that's defined for the web ACL.- Returns:
this
-
captchaConfig
@Stability(Stable) public CfnWebACL.RuleProperty.Builder captchaConfig(CfnWebACL.CaptchaConfigProperty captchaConfig) Sets the value ofCfnWebACL.RuleProperty.getCaptchaConfig()
- Parameters:
captchaConfig
- Specifies how AWS WAF should handleCAPTCHA
evaluations. If you don't specify this, AWS WAF uses theCAPTCHA
configuration that's defined for the web ACL.- Returns:
this
-
challengeConfig
@Stability(Stable) public CfnWebACL.RuleProperty.Builder challengeConfig(IResolvable challengeConfig) Sets the value ofCfnWebACL.RuleProperty.getChallengeConfig()
- Parameters:
challengeConfig
- Specifies how AWS WAF should handleChallenge
evaluations. If you don't specify this, AWS WAF uses the challenge configuration that's defined for the web ACL.- Returns:
this
-
challengeConfig
@Stability(Stable) public CfnWebACL.RuleProperty.Builder challengeConfig(CfnWebACL.ChallengeConfigProperty challengeConfig) Sets the value ofCfnWebACL.RuleProperty.getChallengeConfig()
- Parameters:
challengeConfig
- Specifies how AWS WAF should handleChallenge
evaluations. If you don't specify this, AWS WAF uses the challenge configuration that's defined for the web ACL.- Returns:
this
-
overrideAction
Sets the value ofCfnWebACL.RuleProperty.getOverrideAction()
- Parameters:
overrideAction
- The override action to apply to the rules in a rule group, instead of the individual rule action settings. This is used only for rules whose statements reference a rule group. Rule statements that reference a rule group areRuleGroupReferenceStatement
andManagedRuleGroupStatement
.Set the override action to none to leave the rule group rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
You must set either this
OverrideAction
setting or theAction
setting, but not both:- If the rule statement references a rule group, you must set this override action setting and you must not set the rule's action setting.
- If the rule statement doesn't reference a rule group, you must set the rule action setting and you must not set the rule's override action setting.
- Returns:
this
-
overrideAction
@Stability(Stable) public CfnWebACL.RuleProperty.Builder overrideAction(CfnWebACL.OverrideActionProperty overrideAction) Sets the value ofCfnWebACL.RuleProperty.getOverrideAction()
- Parameters:
overrideAction
- The override action to apply to the rules in a rule group, instead of the individual rule action settings. This is used only for rules whose statements reference a rule group. Rule statements that reference a rule group areRuleGroupReferenceStatement
andManagedRuleGroupStatement
.Set the override action to none to leave the rule group rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
You must set either this
OverrideAction
setting or theAction
setting, but not both:- If the rule statement references a rule group, you must set this override action setting and you must not set the rule's action setting.
- If the rule statement doesn't reference a rule group, you must set the rule action setting and you must not set the rule's override action setting.
- Returns:
this
-
ruleLabels
Sets the value ofCfnWebACL.RuleProperty.getRuleLabels()
- Parameters:
ruleLabels
- Labels to apply to web requests that match the rule match statement. AWS WAF applies fully qualified labels to matching web requests. A fully qualified label is the concatenation of a label namespace and a rule label. The rule's rule group or web ACL defines the label namespace.Rules that run after this rule in the web ACL can match against these labels using a
LabelMatchStatement
.For each label, provide a case-sensitive string containing optional namespaces and a label name, according to the following guidelines:
- Separate each component of the label with a colon.
- Each namespace or name can have up to 128 characters.
- You can specify up to 5 namespaces in a label.
- Don't use the following reserved words in your label specification:
aws
,waf
,managed
,rulegroup
,webacl
,regexpatternset
, oripset
.
For example,
myLabelName
ornameSpace1:nameSpace2:myLabelName
.- Returns:
this
-
ruleLabels
@Stability(Stable) public CfnWebACL.RuleProperty.Builder ruleLabels(List<? extends Object> ruleLabels) Sets the value ofCfnWebACL.RuleProperty.getRuleLabels()
- Parameters:
ruleLabels
- Labels to apply to web requests that match the rule match statement. AWS WAF applies fully qualified labels to matching web requests. A fully qualified label is the concatenation of a label namespace and a rule label. The rule's rule group or web ACL defines the label namespace.Rules that run after this rule in the web ACL can match against these labels using a
LabelMatchStatement
.For each label, provide a case-sensitive string containing optional namespaces and a label name, according to the following guidelines:
- Separate each component of the label with a colon.
- Each namespace or name can have up to 128 characters.
- You can specify up to 5 namespaces in a label.
- Don't use the following reserved words in your label specification:
aws
,waf
,managed
,rulegroup
,webacl
,regexpatternset
, oripset
.
For example,
myLabelName
ornameSpace1:nameSpace2:myLabelName
.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnWebACL.RuleProperty>
- Returns:
- a new instance of
CfnWebACL.RuleProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-