Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save filipeandre/efd776c22b7d6ca816a6f158f994c6a4 to your computer and use it in GitHub Desktop.
Save filipeandre/efd776c22b7d6ca816a6f158f994c6a4 to your computer and use it in GitHub Desktop.
Resources:
RateLimitACL:
Type: AWS::WAFv2::WebACL
Properties:
Name: rate-limit-acl
Scope: REGIONAL
Description: Auto-generated rate-limiting ACL.
DefaultAction:
Allow: {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: rate-limit-acl
- Name: rate-limit-bar
Priority: 1
Action:
Block: {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: rate-limit-bar
Statement:
RateBasedStatement:
AggregateKeyType: "IP"
Limit: 100
ScopeDownStatement:
ByteMatchStatement:
SearchString: "/bar/"
FieldToMatch:
UriPath: {}
TextTransformations:
- Type: URL_DECODE
Priority: 0
PositionalConstraint: "STARTS_WITH"
- Name: rate-limit-foo
Priority: 2
Action:
Block: {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: rate-limit-foo
Statement:
RateBasedStatement:
AggregateKeyType: "IP"
Limit: 500
ScopeDownStatement:
ByteMatchStatement:
SearchString: "/foo/"
FieldToMatch:
UriPath: {}
TextTransformations:
- Type: URL_DECODE
Priority: 0
PositionalConstraint: "STARTS_WITH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment