File tree 1 file changed +33
-1
lines changed
1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1
1
package throttle
2
2
3
+ import (
4
+ "github.com/aws/aws-sdk-go/service/wafregional"
5
+ "github.com/aws/aws-sdk-go/service/wafv2"
6
+ "golang.org/x/time/rate"
7
+ "regexp"
8
+ )
9
+
3
10
// NewDefaultServiceOperationsThrottleConfig returns a ServiceOperationsThrottleConfig with default settings.
4
11
func NewDefaultServiceOperationsThrottleConfig () * ServiceOperationsThrottleConfig {
5
12
return & ServiceOperationsThrottleConfig {
6
- value : map [string ][]throttleConfig {},
13
+ value : map [string ][]throttleConfig {
14
+ wafregional .ServiceID : {
15
+ {
16
+ operationPtn : regexp .MustCompile ("^AssociateWebACL|DisassociateWebACL" ),
17
+ r : rate .Limit (0.5 ),
18
+ burst : 1 ,
19
+ },
20
+ {
21
+ operationPtn : regexp .MustCompile ("^GetWebACLForResource|ListResourcesForWebACL" ),
22
+ r : rate .Limit (1 ),
23
+ burst : 1 ,
24
+ },
25
+ },
26
+ wafv2 .ServiceID : {
27
+ {
28
+ operationPtn : regexp .MustCompile ("^AssociateWebACL|DisassociateWebACL" ),
29
+ r : rate .Limit (0.5 ),
30
+ burst : 1 ,
31
+ },
32
+ {
33
+ operationPtn : regexp .MustCompile ("^GetWebACLForResource|ListResourcesForWebACL" ),
34
+ r : rate .Limit (1 ),
35
+ burst : 1 ,
36
+ },
37
+ },
38
+ },
7
39
}
8
40
}
You can’t perform that action at this time.
0 commit comments