forked from DNXLabs/terraform-aws-ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_variables.tf
200 lines (160 loc) · 5.48 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
# == REQUIRED VARS
variable "name" {
description = "Name of this ECS cluster"
}
variable "environment_linux" {
default = true
description = "linux image for ECS"
}
variable "environment_windows" {
default = false
description = "Windows image for ECS"
}
variable "instance_type_1" {
description = "Instance type for ECS workers (first priority)"
}
variable "instance_type_2" {
description = "Instance type for ECS workers (second priority)"
}
variable "instance_type_3" {
description = "Instance type for ECS workers (third priority)"
}
variable "on_demand_percentage" {
description = "Percentage of on-demand intances vs spot"
default = 100
}
variable "on_demand_base_capacity" {
description = "You can designate a base portion of your total capacity as On-Demand. As the group scales, per your settings, the base portion is provisioned first, while additional On-Demand capacity is percentage-based."
default = 0
}
variable "vpc_id" {
description = "VPC ID to deploy the ECS cluster"
}
variable "private_subnet_ids" {
type = list(string)
description = "List of private subnet IDs for ECS instances and Internal ALB when enabled"
}
variable "public_subnet_ids" {
type = list(string)
description = "List of public subnet IDs for ECS ALB"
}
variable "secure_subnet_ids" {
type = list(string)
description = "List of secure subnet IDs for EFS"
}
variable "certificate_arn" {}
# == OPTIONAL VARS
variable "security_group_ids" {
type = list(string)
default = []
description = "Extra security groups for instances"
}
variable "userdata" {
default = ""
description = "Extra commands to pass to userdata"
}
variable "alb" {
default = true
description = "Whether to deploy an ALB or not with the cluster"
}
variable "alb_only" {
default = false
description = "Whether to deploy only an alb and no cloudFront or not with the cluster"
}
variable "alb_internal" {
default = false
description = "Deploys a second internal ALB for private APIs"
}
variable "asg_min" {
default = 1
description = "Min number of instances for autoscaling group"
}
variable "asg_max" {
default = 4
description = "Max number of instances for autoscaling group"
}
variable "asg_memory_target" {
default = 60
description = "Target average memory percentage to track for autoscaling"
}
variable "alarm_sns_topics" {
default = []
description = "Alarm topics to create and alert on ECS instance metrics"
}
variable "alarm_asg_high_cpu_threshold" {
description = "Max threshold average CPU percentage allowed in a 2 minutes interval (use 0 to disable this alarm)"
default = 80
}
variable "alarm_ecs_high_memory_threshold" {
description = "Max threshold average Memory percentage allowed in a 2 minutes interval (use 0 to disable this alarm)"
default = 80
}
variable "alarm_ecs_high_cpu_threshold" {
description = "Max threshold average CPU percentage allowed in a 2 minutes interval (use 0 to disable this alarm)"
default = 80
}
variable "alarm_alb_latency_anomaly_threshold" {
description = "ALB Latency anomaly detection width (use 0 to disable this alarm)"
default = 2
}
variable "alarm_alb_500_errors_threshold" {
description = "Max threshold of HTTP 500 errors allowed in a 5 minutes interval (use 0 to disable this alarm)"
default = 10
}
variable "alarm_alb_400_errors_threshold" {
description = "Max threshold of HTTP 4000 errors allowed in a 5 minutes interval (use 0 to disable this alarm)"
default = 10
}
variable "alarm_efs_credits_low_threshold" {
description = "Alerts when EFS credits fell below this number in bytes - default 1000000000000 is 1TB of a maximum of 2.31T of credits (use 0 to disable this alarm)"
default = 1000000000000
}
variable "expire_backup_efs" {
default = 0
description = "Number of days the backup will be expired"
}
variable "target_group_arns" {
default = []
type = list(string)
description = "List of target groups for ASG to register"
}
variable "autoscaling_health_check_grace_period" {
default = 300
description = "The length of time that Auto Scaling waits before checking an instance's health status. The grace period begins when an instance comes into service"
}
variable "autoscaling_default_cooldown" {
default = 300
description = "The amount of time, in seconds, after a scaling activity completes before another scaling activity can start"
}
variable "instance_volume_size" {
description = "Volume size for docker volume (in GB)"
default = 22
}
variable "instance_volume_size_root" {
description = "Volume size for root volume (in GB)"
default = 16
}
variable "lb_access_logs_bucket" {
type = string
default = ""
description = "Bucket to store logs from lb access"
}
variable "lb_access_logs_prefix" {
type = string
default = ""
description = "Bucket prefix to store lb access logs"
}
variable "enable_schedule" {
default = false
description = "Enables schedule to shut down and start up instances outside business hours"
}
variable "schedule_cron_start" {
type = string
default = ""
description = "Cron expression to define when to trigger a start of the auto-scaling group. E.g. '0 20 * * *' to start at 8pm GMT time"
}
variable "schedule_cron_stop" {
type = string
default = ""
description = "Cron expression to define when to trigger a stop of the auto-scaling group. E.g. '0 10 * * *' to stop at 10am GMT time"
}