Class CfnWebACL.RuleProperty.Builder

java.lang.Object
software.amazon.awscdk.services.wafv2.CfnWebACL.RuleProperty.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnWebACL.RuleProperty>
Enclosing interface:
CfnWebACL.RuleProperty

@Stability(Stable) public static final class CfnWebACL.RuleProperty.Builder extends Object implements software.amazon.jsii.Builder<CfnWebACL.RuleProperty>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder name(String name)
      Parameters:
      name - The name of the rule. This parameter is required. If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule's VisibilityConfig settings. AWS WAF doesn't automatically update the metric name when you update the rule name.
      Returns:
      this
    • priority

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder priority(Number priority)
      Parameters:
      priority - If you define more than one Rule in a WebACL , AWS WAF evaluates each request against the Rules in order based on the value of Priority . 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

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder statement(IResolvable statement)
      Parameters:
      statement - The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement . This parameter is required.
      Returns:
      this
    • statement

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder statement(CfnWebACL.StatementProperty statement)
      Parameters:
      statement - The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement . This parameter is required.
      Returns:
      this
    • visibilityConfig

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder visibilityConfig(IResolvable visibilityConfig)
      Parameters:
      visibilityConfig - Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required. If you change the name of a Rule 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)
      Parameters:
      visibilityConfig - Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required. If you change the name of a Rule 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

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder action(IResolvable action)
      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 and ManagedRuleGroupStatement .

      You must set either this Action setting or the rule's OverrideAction , 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)
      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 and ManagedRuleGroupStatement .

      You must set either this Action setting or the rule's OverrideAction , 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

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder captchaConfig(IResolvable captchaConfig)
      Parameters:
      captchaConfig - Specifies how AWS WAF should handle CAPTCHA evaluations. If you don't specify this, AWS WAF uses the CAPTCHA configuration that's defined for the web ACL.
      Returns:
      this
    • captchaConfig

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder captchaConfig(CfnWebACL.CaptchaConfigProperty captchaConfig)
      Parameters:
      captchaConfig - Specifies how AWS WAF should handle CAPTCHA evaluations. If you don't specify this, AWS WAF uses the CAPTCHA configuration that's defined for the web ACL.
      Returns:
      this
    • challengeConfig

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder challengeConfig(IResolvable challengeConfig)
      Parameters:
      challengeConfig - Specifies how AWS WAF should handle Challenge 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)
      Parameters:
      challengeConfig - Specifies how AWS WAF should handle Challenge evaluations. If you don't specify this, AWS WAF uses the challenge configuration that's defined for the web ACL.
      Returns:
      this
    • overrideAction

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder overrideAction(IResolvable overrideAction)
      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 are RuleGroupReferenceStatement and ManagedRuleGroupStatement .

      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 the Action 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)
      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 are RuleGroupReferenceStatement and ManagedRuleGroupStatement .

      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 the Action 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

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder ruleLabels(IResolvable ruleLabels)
      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 , or ipset .

      For example, myLabelName or nameSpace1:nameSpace2:myLabelName .

      Returns:
      this
    • ruleLabels

      @Stability(Stable) public CfnWebACL.RuleProperty.Builder ruleLabels(List<? extends Object> ruleLabels)
      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 , or ipset .

      For example, myLabelName or nameSpace1:nameSpace2:myLabelName .

      Returns:
      this
    • build

      @Stability(Stable) public CfnWebACL.RuleProperty build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnWebACL.RuleProperty>
      Returns:
      a new instance of CfnWebACL.RuleProperty
      Throws:
      NullPointerException - if any required attribute was not provided