File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ resource "aws_api_gateway_usage_plan" "usage_plan" {
21
21
}
22
22
}
23
23
24
+ dynamic "throttle_settings" {
25
+ for_each = var. enable_throttling == true ? [1 ] : []
26
+ content {
27
+ burst_limit = var. burst_limit
28
+ rate_limit = var. rate_limit
29
+ }
30
+ }
31
+
24
32
tags = {
25
33
Name = var.name
26
34
}
Original file line number Diff line number Diff line change @@ -48,6 +48,24 @@ variable "period" {
48
48
default = " MONTH"
49
49
}
50
50
51
+ variable "enable_throttling" {
52
+ description = " whether to enable throttling"
53
+ type = bool
54
+ default = false
55
+ }
56
+
57
+ variable "burst_limit" {
58
+ description = " The maximum number of requests that API Gateway allows to be bursted across the entire API at the same moment."
59
+ type = number
60
+ default = 5000
61
+ }
62
+
63
+ variable "rate_limit" {
64
+ description = " The rate limit, as a number of requests per second, to apply to this usage plan."
65
+ type = number
66
+ default = 100
67
+ }
68
+
51
69
variable "api_keys" {
52
70
description = " List of api keys created and assigned to the usage plan"
53
71
type = map (
You can’t perform that action at this time.
0 commit comments