-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvariables.tf
235 lines (194 loc) · 6.98 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
variable "resource_prefix" {
type = string
description = "Naming prefix to use for resources to be provisioned"
}
variable "account_name" {
type = string
description = "Name representing the current AWS account to be injected into web container environment variables"
default = "Unknown"
}
variable "acm_certificate_domain" {
type = string
description = "The domain of the certificate to be registered with the ALB listener"
}
variable "ecs_cluster_id" {
type = string
}
variable "ecs_cluster_name" {
type = string
description = "Only needed if enable_monitoring = 1"
default = ""
}
variable "ecs_task_definition_arn" {
type = string
description = "ARN of ECS task definition to use with service"
}
variable "enable_monitoring" {
type = bool
default = false
}
variable "monitoring_evaluation_periods" {
type = number
default = 1
description = "Number of periods to evaluate for the alarm"
}
variable "monitoring_slack_webhook_url" {
type = string
default = ""
}
variable "monitoring_slack_channel" {
type = string
default = ""
}
variable "monitoring_period" {
type = number
default = 300
description = "Duration (in seconds) to evaluate for the alarm"
}
# variable "log_retention_in_days" {
# type = string
# description = "Number of days CloudWatch logs for all ECS task containers should be retained."
# default = "30"
# }
variable "app_domain" {
type = string
description = "The domain at which the application will be registered"
}
variable "route53_hosted_zone_id" {
type = string
description = "The Hosted Zone ID at which the app_domain will be registered"
}
variable "task_count" {
type = string
default = 1
}
variable "alb_internal" {
type = string
default = 1
}
variable "alb_listener_default_action" {
type = string
default = "forward"
description = "Only forward and redirect are currently supported"
}
variable "alb_allowed_ingress_cidr_blocks" {
type = list(string)
default = ["10.0.0.0/8"]
description = "[Optional] CIDR block allowed to access load balancer. Defaults to 10.0.0.0/8."
}
variable "alb_default_target_group_arn" {
type = string
default = ""
description = "[Optional] ARN of the default target group for the load balancer. Defaults to the target group created by this module."
}
variable "alb_subnets_private" {
type = list(string)
description = "List of Ids of subnets in which load balancer will be hosted if alb_internal = true. App will be hosted in private subnets."
}
variable "alb_subnets_public" {
type = list(string)
description = "List of Ids of subnets in which load balancer will be hosted if alb_internal = false"
}
variable "alb_listener_default_redirect_host" {
type = string
description = "Host to which request will be redirected (only used if alb_listener_default_action is redirect)"
default = "#{host}"
}
variable "alb_listener_default_redirect_port" {
type = string
description = "Port used when redirecting request from ALB (only used if alb_listener_default_action is redirect)"
default = "#{port}"
}
variable "alb_listener_default_redirect_path" {
type = string
description = "Path to which request will be redirected (only used if alb_listener_default_action is redirect)"
default = "/#{path}"
}
variable "alb_listener_default_redirect_protocol" {
type = string
description = "Protocol used when redirecting request from ALB (only used if alb_listener_default_action is redirect)"
default = "#{protocol}"
}
variable "alb_listener_default_redirect_query" {
type = string
description = "The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading `?` (only used if alb_listener_default_action is redirect)"
default = "#{query}"
}
variable "alb_listener_default_redirect_status_code" {
type = string
description = "Status code used when redirecting request from ALB (only used if alb_listener_default_action is redirect)"
default = "HTTP_301"
}
variable "vpc_id" {
type = string
description = "ID of VPC in which all infrastucture will be provisioned"
}
variable "app_port" {
type = string
default = 443
}
variable "app_healthcheck_endpoint" {
type = string
default = "/health-check"
description = "[Optional] Endpoint that the Application Load Balancer will use to ensure a task is healthy. Defaults to /health-check"
}
variable "enable_autoscale" {
type = bool
default = false
description = "[Optional] Autoscale - enables autoscaling for ecs tasks"
}
variable "task_max_instance_count" {
type = string
default = 2
description = "[Optional] Autoscale - max task count used for autoscaling"
}
variable "task_scale_out_memory_threshold_percent" {
type = number
default = 50
description = "[Optional] Autoscale - When average memory utilization % is greater than or equal to value increase tasks by 1"
}
variable "task_scale_out_cpu_threshold_percent" {
type = number
default = 60
description = "[Optional] Autoscale - When average cpu utilization % is greater than or equal to value increase tasks by 1"
}
variable "task_scale_in_memory_threshold_percent" {
type = number
default = 25
description= "[Optional] Autoscale - When both cpu and memory are below scale in thresholds decrease tasks by 1. Only applies when the total number of tasks exceed the minimum task count. number of running tasks determined by HealthyHostCount."
}
variable "task_scale_in_cpu_threshold_percent" {
type = number
default = 30
description = "[Optional] Autoscale - When both cpu and memory are below scale in thresholds decrease tasks by 1. Only applies when the total number of tasks exceed the minimum task count. number of running tasks determined by HealthyHostCount."
}
variable "task_scale_in_cooldown_period" {
type = number
default = 300
description = "[Optional] Autoscale - scale in cooldown period, in seconds"
}
variable "task_scale_out_cooldown_period" {
type = number
default = 300
description = "[Optional] Autoscale - scale out cooldown period, in seconds"
}
variable "task_alarm_period" {
type = number
default = 60
description = "[Optional] Autoscale - period of time to evaluate, in seconds"
}
variable "task_alarm_evaluation_periods" {
type = number
default = 3
description = "[Optional] Autoscale - number of data points to use for evaluation"
}
variable "target_group_slow_start" {
type = number
default = 300
description = "[Optional] Load balancer - time period to wait before forwarding requests to the target group, time in seconds."
}
variable "service_depends_on" {
type = any
default = null
description = "[Optional] service - resources that the service depends on. Will delay deployment of service until resources available"
}