Interface Rule.Builder
-
- All Superinterfaces:
Buildable,CopyableBuilder<Rule.Builder,Rule>,SdkBuilder<Rule.Builder,Rule>,SdkPojo
- Enclosing class:
- Rule
public static interface Rule.Builder extends SdkPojo, CopyableBuilder<Rule.Builder,Rule>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Rule.Builderaction(Consumer<RuleAction.Builder> action)The action that WAF should take on a web request when it matches the rule statement.Rule.Builderaction(RuleAction action)The action that WAF should take on a web request when it matches the rule statement.default Rule.BuildercaptchaConfig(Consumer<CaptchaConfig.Builder> captchaConfig)Specifies how WAF should handleCAPTCHAevaluations.Rule.BuildercaptchaConfig(CaptchaConfig captchaConfig)Specifies how WAF should handleCAPTCHAevaluations.default Rule.BuilderchallengeConfig(Consumer<ChallengeConfig.Builder> challengeConfig)Specifies how WAF should handleChallengeevaluations.Rule.BuilderchallengeConfig(ChallengeConfig challengeConfig)Specifies how WAF should handleChallengeevaluations.Rule.Buildername(String name)The name of the rule.default Rule.BuilderoverrideAction(Consumer<OverrideAction.Builder> overrideAction)The action to use in the place of the action that results from the rule group evaluation.Rule.BuilderoverrideAction(OverrideAction overrideAction)The action to use in the place of the action that results from the rule group evaluation.Rule.Builderpriority(Integer priority)If you define more than oneRulein aWebACL, WAF evaluates each request against theRulesin order based on the value ofPriority.Rule.BuilderruleLabels(Collection<Label> ruleLabels)Labels to apply to web requests that match the rule match statement.Rule.BuilderruleLabels(Consumer<Label.Builder>... ruleLabels)Labels to apply to web requests that match the rule match statement.Rule.BuilderruleLabels(Label... ruleLabels)Labels to apply to web requests that match the rule match statement.default Rule.Builderstatement(Consumer<Statement.Builder> statement)The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.Rule.Builderstatement(Statement statement)The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.default Rule.BuildervisibilityConfig(Consumer<VisibilityConfig.Builder> visibilityConfig)Defines and enables Amazon CloudWatch metrics and web request sample collection.Rule.BuildervisibilityConfig(VisibilityConfig visibilityConfig)Defines and enables Amazon CloudWatch metrics and web request sample collection.-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
-
-
-
Method Detail
-
name
Rule.Builder name(String name)
The name of the rule.
If you change the name of a
Ruleafter you create it and you want the rule's metric name to reflect the change, update the metric name in the rule'sVisibilityConfigsettings. WAF doesn't automatically update the metric name when you update the rule name.- Parameters:
name- The name of the rule.If you change the name of a
Ruleafter you create it and you want the rule's metric name to reflect the change, update the metric name in the rule'sVisibilityConfigsettings. WAF doesn't automatically update the metric name when you update the rule name.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
priority
Rule.Builder priority(Integer priority)
If you define more than one
Rulein aWebACL, WAF evaluates each request against theRulesin order based on the value ofPriority. WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.- Parameters:
priority- If you define more than oneRulein aWebACL, WAF evaluates each request against theRulesin order based on the value ofPriority. WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
statement
Rule.Builder statement(Statement statement)
The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
- Parameters:
statement- The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
statement
default Rule.Builder statement(Consumer<Statement.Builder> statement)
The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
This is a convenience method that creates an instance of theStatement.Builderavoiding the need to create one manually viaStatement.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tostatement(Statement).- Parameters:
statement- a consumer that will call methods onStatement.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
statement(Statement)
-
action
Rule.Builder action(RuleAction action)
The action that WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include
RuleGroupReferenceStatementandManagedRuleGroupStatement.You must specify either this
Actionsetting or the ruleOverrideActionsetting, but not both:-
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
-
If the rule statement references a rule group, use the override action setting and not this action setting.
- Parameters:
action- The action that WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include
RuleGroupReferenceStatementandManagedRuleGroupStatement.You must specify either this
Actionsetting or the ruleOverrideActionsetting, but not both:-
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
-
If the rule statement references a rule group, use the override action setting and not this action setting.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
action
default Rule.Builder action(Consumer<RuleAction.Builder> action)
The action that WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include
RuleGroupReferenceStatementandManagedRuleGroupStatement.You must specify either this
Actionsetting or the ruleOverrideActionsetting, but not both:-
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
-
If the rule statement references a rule group, use the override action setting and not this action setting.
RuleAction.Builderavoiding the need to create one manually viaRuleAction.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed toaction(RuleAction).- Parameters:
action- a consumer that will call methods onRuleAction.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
action(RuleAction)
-
-
overrideAction
Rule.Builder overrideAction(OverrideAction overrideAction)
The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.
You can only use this for rule statements that reference a rule group, like
RuleGroupReferenceStatementandManagedRuleGroupStatement.This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with
Countaction, in your rule group reference statement settings.- Parameters:
overrideAction- The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.You can only use this for rule statements that reference a rule group, like
RuleGroupReferenceStatementandManagedRuleGroupStatement.This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with
Countaction, in your rule group reference statement settings.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
overrideAction
default Rule.Builder overrideAction(Consumer<OverrideAction.Builder> overrideAction)
The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.
You can only use this for rule statements that reference a rule group, like
RuleGroupReferenceStatementandManagedRuleGroupStatement. This is a convenience method that creates an instance of theThis option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with
Countaction, in your rule group reference statement settings.OverrideAction.Builderavoiding the need to create one manually viaOverrideAction.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tooverrideAction(OverrideAction).- Parameters:
overrideAction- a consumer that will call methods onOverrideAction.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
overrideAction(OverrideAction)
-
ruleLabels
Rule.Builder ruleLabels(Collection<Label> ruleLabels)
Labels to apply to web requests that match the rule match statement. 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,
myLabelNameornameSpace1:nameSpace2:myLabelName.- Parameters:
ruleLabels- Labels to apply to web requests that match the rule match statement. 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,
myLabelNameornameSpace1:nameSpace2:myLabelName.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
ruleLabels
Rule.Builder ruleLabels(Label... ruleLabels)
Labels to apply to web requests that match the rule match statement. 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,
myLabelNameornameSpace1:nameSpace2:myLabelName.- Parameters:
ruleLabels- Labels to apply to web requests that match the rule match statement. 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,
myLabelNameornameSpace1:nameSpace2:myLabelName.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
ruleLabels
Rule.Builder ruleLabels(Consumer<Label.Builder>... ruleLabels)
Labels to apply to web requests that match the rule match statement. 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,
This is a convenience method that creates an instance of themyLabelNameornameSpace1:nameSpace2:myLabelName.Label.Builderavoiding the need to create one manually viaLabel.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed to#ruleLabels(List.- Parameters:
ruleLabels- a consumer that will call methods onLabel.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#ruleLabels(java.util.Collection
-
-
visibilityConfig
Rule.Builder visibilityConfig(VisibilityConfig visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
If you change the name of a
Ruleafter you create it and you want the rule's metric name to reflect the change, update the metric name as well. WAF doesn't automatically update the metric name.- Parameters:
visibilityConfig- Defines and enables Amazon CloudWatch metrics and web request sample collection.If you change the name of a
Ruleafter you create it and you want the rule's metric name to reflect the change, update the metric name as well. WAF doesn't automatically update the metric name.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
visibilityConfig
default Rule.Builder visibilityConfig(Consumer<VisibilityConfig.Builder> visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
If you change the name of a
This is a convenience method that creates an instance of theRuleafter you create it and you want the rule's metric name to reflect the change, update the metric name as well. WAF doesn't automatically update the metric name.VisibilityConfig.Builderavoiding the need to create one manually viaVisibilityConfig.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tovisibilityConfig(VisibilityConfig).- Parameters:
visibilityConfig- a consumer that will call methods onVisibilityConfig.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
visibilityConfig(VisibilityConfig)
-
captchaConfig
Rule.Builder captchaConfig(CaptchaConfig captchaConfig)
Specifies how WAF should handle
CAPTCHAevaluations. If you don't specify this, WAF uses theCAPTCHAconfiguration that's defined for the web ACL.- Parameters:
captchaConfig- Specifies how WAF should handleCAPTCHAevaluations. If you don't specify this, WAF uses theCAPTCHAconfiguration that's defined for the web ACL.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
captchaConfig
default Rule.Builder captchaConfig(Consumer<CaptchaConfig.Builder> captchaConfig)
Specifies how WAF should handle
This is a convenience method that creates an instance of theCAPTCHAevaluations. If you don't specify this, WAF uses theCAPTCHAconfiguration that's defined for the web ACL.CaptchaConfig.Builderavoiding the need to create one manually viaCaptchaConfig.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tocaptchaConfig(CaptchaConfig).- Parameters:
captchaConfig- a consumer that will call methods onCaptchaConfig.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
captchaConfig(CaptchaConfig)
-
challengeConfig
Rule.Builder challengeConfig(ChallengeConfig challengeConfig)
Specifies how WAF should handle
Challengeevaluations. If you don't specify this, WAF uses the challenge configuration that's defined for the web ACL.- Parameters:
challengeConfig- Specifies how WAF should handleChallengeevaluations. If you don't specify this, WAF uses the challenge configuration that's defined for the web ACL.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
challengeConfig
default Rule.Builder challengeConfig(Consumer<ChallengeConfig.Builder> challengeConfig)
Specifies how WAF should handle
This is a convenience method that creates an instance of theChallengeevaluations. If you don't specify this, WAF uses the challenge configuration that's defined for the web ACL.ChallengeConfig.Builderavoiding the need to create one manually viaChallengeConfig.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tochallengeConfig(ChallengeConfig).- Parameters:
challengeConfig- a consumer that will call methods onChallengeConfig.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
challengeConfig(ChallengeConfig)
-
-