Class CfnRateBasedRulePropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.wafregional.CfnRateBasedRulePropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:20:06.019Z") @Stability(Stable) public class CfnRateBasedRulePropsMixin extends Mixin implements software.constructs.IMixin

This is AWS WAF Classic documentation.

For more information, see AWS WAF Classic in the developer guide.

For the latest version of AWS WAF , use the AWS WAF V2 API and see the AWS WAF Developer Guide . With the latest version, AWS WAF has a single set of endpoints for regional and global use.

A RateBasedRule is identical to a regular Rule , with one addition: a RateBasedRule counts the number of requests that arrive from a specified IP address every five minutes. For example, based on recent requests that you've seen from an attacker, you might create a RateBasedRule that includes the following conditions:

  • The requests come from 192.0.2.44.
  • They contain the value BadBot in the User-Agent header.

In the rule, you also define the rate limit as 15,000.

Requests that meet both of these conditions and exceed 15,000 requests every five minutes trigger the rule's action (block or count), which is defined in the web ACL.

Note you can only create rate-based rules using an CloudFormation template. To add the rate-based rules created through CloudFormation to a web ACL, use the AWS WAF console, API, or command line interface (CLI). For more information, see UpdateWebACL .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.wafregional.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnRateBasedRulePropsMixin cfnRateBasedRulePropsMixin = CfnRateBasedRulePropsMixin.Builder.create(CfnRateBasedRuleMixinProps.builder()
         .matchPredicates(List.of(PredicateProperty.builder()
                 .dataId("dataId")
                 .negated(false)
                 .type("type")
                 .build()))
         .metricName("metricName")
         .name("name")
         .rateKey("rateKey")
         .rateLimit(123)
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for CfnRateBasedRulePropsMixin.
    static interface 
    Specifies the ByteMatchSet , IPSet , SqlInjectionMatchSet , XssMatchSet , RegexMatchSet , GeoMatchSet , and SizeConstraintSet objects that you want to add to a Rule and, for each object, indicates whether you want to negate the settings, for example, requests that do NOT originate from the IP address 192.0.2.44.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.constructs.IMixin

    software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final List<String>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Create a mixin to apply properties to AWS::WAFRegional::RateBasedRule.
     
    Create a mixin to apply properties to AWS::WAFRegional::RateBasedRule.
    protected
    CfnRateBasedRulePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    CfnRateBasedRulePropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyTo(software.constructs.IConstruct construct)
    Apply the mixin properties to the construct.
     
    protected IMergeStrategy
     
    supports(software.constructs.IConstruct construct)
    Check if this mixin supports the given construct.

    Methods inherited from class software.amazon.awscdk.Mixin

    isMixin

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnRateBasedRulePropsMixin

      protected CfnRateBasedRulePropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnRateBasedRulePropsMixin

      protected CfnRateBasedRulePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnRateBasedRulePropsMixin

      @Stability(Stable) public CfnRateBasedRulePropsMixin(@NotNull CfnRateBasedRuleMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::WAFRegional::RateBasedRule.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnRateBasedRulePropsMixin

      @Stability(Stable) public CfnRateBasedRulePropsMixin(@NotNull CfnRateBasedRuleMixinProps props)
      Create a mixin to apply properties to AWS::WAFRegional::RateBasedRule.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnRateBasedRuleMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()