class CfnRateBasedRulePropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.WAFRegional.Mixins.CfnRateBasedRulePropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awswafregional/mixins#CfnRateBasedRulePropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.wafregional.mixins.CfnRateBasedRulePropsMixin |
Python | aws_cdk.mixins_preview.aws_wafregional.mixins.CfnRateBasedRulePropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_wafregional » mixins » CfnRateBasedRulePropsMixin |
Implements
IMixin
Extends
Mixin
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 { mixins } from '@aws-cdk/mixins-preview';
import { mixins as wafregional_mixins } from '@aws-cdk/mixins-preview/aws-wafregional';
const cfnRateBasedRulePropsMixin = new wafregional_mixins.CfnRateBasedRulePropsMixin({
matchPredicates: [{
dataId: 'dataId',
negated: false,
type: 'type',
}],
metricName: 'metricName',
name: 'name',
rateKey: 'rateKey',
rateLimit: 123,
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnRateBasedRulePropsMixin(props: CfnRateBasedRuleMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Rate Based Rule Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::WAFRegional::RateBasedRule.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): void
Parameters
- construct
IConstruct
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript