-
Notifications
You must be signed in to change notification settings - Fork 3
/
variables.tf
282 lines (232 loc) · 7.14 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
// labelling
variable "name" {
type = string
default = "fargate"
description = "Name of the fargate instance"
}
variable "namespace" {
type = string
}
variable "stage" {
type = string
description = "Deployment stage i.e. environment name"
}
variable "tags" {
type = map(string)
description = "A set of tags that will be applied to all resources created by this module"
}
variable "include_region" {
type = bool
default = false
description = "If set to true the current providers region will be appended to any global AWS resources such as IAM roles"
}
variable "region" {
type = string
description = "AWS Region the Fargate service is deployed to"
}
variable "vpc_id" {
type = string
description = "VPC Id"
}
variable "subnet_ids" {
type = list(string)
description = "A list of subnet ids the fargate service will be deployed to"
}
variable "sg_egress_cidr_blocks" {
type = list(string)
default = ["0.0.0.0/0"]
description = "List of egress CIDR blocks that will be applied to the created Fargate service"
}
variable "ingress_sg_list" {
type = list(string)
default = []
description = "List of ingress security groups that will be applied to the created Fargate service"
}
variable "assign_public_ip" {
type = bool
default = false
description = "Assign public IP to the Fargate service"
}
variable "sg_list" {
type = list(string)
default = []
description = "List of security groups that will be applied to the created Fargate service"
}
variable "target_group_arns" {
type = list(string)
default = []
description = "A list of target group ARNs"
}
variable "port" {
type = number
default = 5060
description = "The port the service is available from"
}
variable "ecs_cluster_arn" {
type = string
description = "ECS Cluster ARN"
}
variable "fargate_platform_version" {
type = string
default = "LATEST"
description = "The version of the Fargate platform"
}
variable "task_definition" {
type = string
description = "The family and revision (family:revision) or full ARN of the task definition that you want to run in your service"
}
variable "desired_count" {
type = number
description = "desired number of container instances running"
}
variable "min_healthy_percent" {
type = number
default = 100
description = "min percent of healthy container instances"
}
variable "max_percent" {
type = number
default = 200
description = "max percent of healthy container instances"
}
variable "wait_for_steady_state" {
type = bool
default = false
description = "Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing"
}
variable "health_check_grace_period" {
type = number
default = 0
description = "Number of seconds that ECS service scheduler should ignore unhealthy ELB target/container/route 53 health checks after a task enters a RUNNING state"
}
// Monitoring
variable "create_connection_error_alarm" {
type = bool
default = false
description = "Set to true if connection error alarm should be created"
}
variable "create_target_response_time_alarm" {
type = bool
default = false
description = "Set to true if target response time alarm should be created"
}
variable "create_unhealthy_host_count_alarm" {
type = bool
default = false
description = "Set to true if unhealthy host count alarm should be created"
}
variable "create_request_count_alarm" {
type = bool
default = false
description = "Set to true if request count alarm should be created"
}
variable "create_success_responses_alarm" {
type = bool
default = false
description = "Set to true if success responses alarm should be created"
}
variable "alarm_data_missing_action" {
type = string
default = "missing"
description = "Missing data action for success responses alarm. Possible values: missing or breaching"
}
variable "enable_slack_notifications" {
type = bool
default = false
description = "Indicates if slack notifications should be enabled or not. If true, slack_webhook_url must be provided."
}
variable "slack_webhook_url" {
type = string
default = ""
description = "Slack webhook URL for Cloudwatch alarm notifications"
}
variable "monit_resp_success_percentage" {
type = string
default = "99"
description = "What percentage of requests should be responded to with 2xx"
}
variable "monit_target_response_time" {
type = string
default = "0.5"
description = "service response time in seconds greater than or equal to"
}
variable "deployment_controller" {
description = "Type of deployment controller. Valid values: CODE_DEPLOY, ECS, EXTERNAL. Default: ECS"
default = "ECS"
}
variable "monitoring_config" {
type = list(object({
load_balancer_arn_suffix = string
target_group_arn_suffix = string
// some of the defaulted properties, such as monitoring period, can be added here
}))
}
variable "enable_codedeploy_control" {
type = bool
default = false
description = "Setting this variable to true configures Fargate service terraform lifecycle to ignore changes done to the task definition and load balancer config. These will be controlled by code deploy."
}
/** Autoscaling **/
variable "enable_autoscaling" {
type = bool
default = false
description = "Indicate if autoscaling should be enabled or not"
}
variable "ecs_cluster_name" {
type = string
description = "Name of the ECS cluster"
}
variable "min_count" {
type = number
default = 1
description = "Minimum number of tasks in the service, used only when autoscaling is enabled"
}
variable "max_count" {
type = number
default = 1
description = "Maximum number of tasks in the service, used only when autoscaling is enabled"
}
variable "memory_utilization_low_period" {
type = number
default = 300
description = "Duration of the monitoring period"
}
variable "memory_utilization_low_threshold" {
type = number
default = 20
description = "Low memory threshold"
}
variable "memory_utilization_high_period" {
type = number
default = 300
description = "Duration of the monitoring period"
}
variable "memory_utilization_high_threshold" {
type = number
default = 60
description = "High memory threshold"
}
variable "cpu_utilization_low_period" {
type = number
default = 300
description = "Duration of the monitoring period"
}
variable "cpu_utilization_low_threshold" {
type = number
default = 20
description = "Low CPU threshold"
}
variable "cpu_utilization_high_period" {
type = number
default = 300
description = "Duration of the monitoring period"
}
variable "cpu_utilization_high_threshold" {
type = number
default = 60
description = "High CPU threshold"
}
variable "low_cpu_alarm_enabled" {
type = bool
description = "Indicates if the low cpu alarm is enabled"
}