Class CfnRateBasedRulePropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,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
BadBotin theUser-Agentheader.
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 ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnRateBasedRulePropsMixin.static interfaceSpecifies theByteMatchSet,IPSet,SqlInjectionMatchSet,XssMatchSet,RegexMatchSet,GeoMatchSet, andSizeConstraintSetobjects that you want to add to aRuleand, 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.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::WAFRegional::RateBasedRule.Create a mixin to apply properties toAWS::WAFRegional::RateBasedRule.protectedCfnRateBasedRulePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRateBasedRulePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnRateBasedRuleMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 toAWS::WAFRegional::RateBasedRule.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnRateBasedRulePropsMixin
Create a mixin to apply properties toAWS::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. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-