@gammarers/aws-waf-ip-rate-limit-rule
Version:
This is an AWS CDK Rate Limit Rule on WAF V2.
70 lines (49 loc) • 2.18 kB
Markdown
# AWS WAF(V2) IP Rete Limit Rule
[](https://github.com/gammarers/aws-waf-ip-rate-limit-rule/blob/main/LICENSE)
[](https://www.npmjs.com/package/@gammarers/aws-waf-ip-rate-limit-rule)
[](https://pypi.org/project/gammarers.aws-waf-ip-rate-limit-rule/)
[](https://github.com/gammarers/aws-waf-ip-rate-limit-rule/actions/workflows/release.yml)
[](https://github.com/gammarers/aws-waf-ip-rate-limit-rule/releases)
[](https://constructs.dev/packages/@gammarers/aws-waf-ip-rate-limit-rule)
This is an AWS CDK WAF IP Rate Limit Rule
## Resources
This construct creating resource list.
- WAF V2 RuleGroup
## Install
### TypeScript
#### install by npm
```shell
npm install @gammarers/aws-waf-ip-rate-limit-rule
```
#### install by yarn
```shell
yarn add @gammarers/aws-waf-ip-rate-limit-rule
```
### Python
```shell
pip install gammarers.aws-waf-ip-rate-limit-rule
```
## Example
```typescript
import { WAFIPRateLimitRule } from '@gammarers/aws-waf-ip-rate-limit-rule';
const ipRateLimitRule = new WAFIPRateLimitRule({
rateLimit: 100,
});
new wafv2.CfnWebACL(stack, 'WebACL', {
defaultAction: { allow: {} },
scope: 'CLOUD_FRONT',
name: 'WebAclWithCustomRules',
visibilityConfig: {
cloudWatchMetricsEnabled: true,
metricName: 'WebAclMetric',
sampledRequestsEnabled: true,
},
rules: [
ipRateLimitRule.blockRule({
priority: 1,
}),
],
});
```
## License
This project is licensed under the Apache-2.0 License.