-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
303 lines (257 loc) · 9.57 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
variable "name" {
description = "Name of the product/project/application"
type = string
default = ""
}
##############################
# ECS
##############################
variable "link_ecs_to_asg_capacity_provider" {
description = "Specify whether to link ECS to autoscaling group capacity provider"
type = bool
default = false
}
variable "cluster_tags" {
type = map(any)
default = {}
description = "tags to be added to ECS cluster"
}
##############################
# ECS - service
##############################
variable "launch_type" {
type = string
description = "The launch type on which to run your task.(EC2|FARGATE)"
default = "EC2"
}
# tflint-ignore: terraform_unused_declarations
variable "platform_version" {
description = "Platform version (applicable for FARGATE launch type)"
type = string
default = "LATEST"
}
variable "service_map" {
description = "A map of services to deploy"
type = map(any)
default = {}
}
variable "service_task_execution_role_arn" {
description = "Default IAM role for ECS execution"
type = string
default = ""
}
variable "service_task_role_arn" {
description = "Default IAM role for ECS task"
type = string
default = ""
}
variable "service_subnets" {
description = "Private subnets for ECS"
type = list(string)
default = []
}
variable "service_security_groups" {
description = "Security group IDs to attach to your ECS Service"
type = list(string)
default = []
}
variable "service_deployment_maximum_percent" {
description = "Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy."
type = number
default = 200
}
variable "service_deployment_minimum_healthy_percent" {
description = "Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment."
type = number
default = 100
}
variable "assign_public_ip" {
description = "Enable a public IP address for the container"
type = bool
default = false
}
variable "enable_execute_command" {
description = "Specifies whether to enable Amazon ECS Exec for the tasks within the service"
type = bool
default = false
}
variable "service_tags" {
type = map(any)
default = {}
description = "tags to be added to task definitions"
}
################################################################################
# Autoscaling group
################################################################################
variable "asg_create" {
description = "Specify whether to create ASG resource"
type = bool
default = false
}
variable "create_launch_template" {
description = "Create a launch template"
type = bool
default = true
}
variable "asg_name" {
description = "Name of ASG resource"
type = string
default = ""
}
variable "asg_instance_name" {
description = "Name that is propogated to launched EC2 instances via a tag - if not provided, defaults to `var.name`"
type = string
default = ""
}
variable "asg_min_size" {
description = "The minimum size of the autoscaling group"
type = number
default = null
}
variable "asg_max_size" {
description = "The maximum size of the autoscaling group"
type = number
default = null
}
variable "asg_desired_capacity" {
description = "The number of Amazon EC2 instances that should be running in the autoscaling group"
type = number
default = null
}
variable "asg_ignore_desired_capacity_changes" {
description = "Determines whether the `desired_capacity` value is ignored after initial apply. See README note for more details"
type = bool
default = true
}
variable "asg_wait_for_capacity_timeout" {
description = "A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to '0' causes Terraform to skip all Capacity Waiting behavior."
type = string
default = null
}
variable "asg_protect_from_scale_in" {
description = "Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events."
type = bool
default = false
}
variable "asg_health_check_type" {
description = "`EC2` or `ELB`. Controls how health checking is done"
type = string
default = "ELB"
}
variable "asg_instance_market_options" {
description = "The market (purchasing) option for the instance"
type = any
default = null
}
################################################################################
# Autoscaling group - launch template
################################################################################
variable "asg_launch_template_description" {
description = "Description of the launch template"
type = string
default = null
}
variable "asg_image_id" {
description = "The AMI from which to launch the instance"
type = string
default = ""
}
variable "asg_instance_type" {
description = "The type of the instance to launch"
type = string
default = "t2.micro"
}
variable "asg_ebs_optimized" {
description = "If true, the launched EC2 instance will be EBS-optimized"
type = bool
default = true
}
variable "asg_enable_monitoring" {
description = "Enables/disables detailed monitoring"
type = bool
default = true
}
variable "asg_enabled_metrics" {
description = "A list of metrics to collect. The allowed values are `GroupDesiredCapacity`, `GroupInServiceCapacity`, `GroupPendingCapacity`, `GroupMinSize`, `GroupMaxSize`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupStandbyCapacity`, `GroupTerminatingCapacity`, `GroupTerminatingInstances`, `GroupTotalCapacity`, `GroupTotalInstances`"
type = list(string)
default = ["GroupDesiredCapacity", "GroupInServiceCapacity", "GroupPendingCapacity", "GroupMinSize", "GroupMaxSize", "GroupInServiceInstances", "GroupPendingInstances", "GroupStandbyInstances", "GroupStandbyCapacity", "GroupTerminatingCapacity", "GroupTerminatingInstances", "GroupTotalCapacity", "GroupTotalInstances"]
}
variable "asg_user_data_base64" {
description = "The Base64-encoded user data to provide when launching the instance"
type = string
default = null
}
variable "asg_volume_size" {
description = "Specify the volume size for the root ebs"
type = string
default = 30
}
variable "asg_iam_instance_profile_arn" {
description = "The IAM Instance Profile ARN to launch the instance with"
type = string
default = null
}
################################################################################
# Autoscaling group - network
################################################################################
variable "asg_subnets" {
description = "A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with `availability_zones`"
type = list(string)
default = null
}
variable "asg_network_interface_security_groups" {
description = "A list of security group IDs to associate"
type = list(string)
default = null
}
variable "asg_placement" {
description = "The placement of the instance"
type = map(string)
default = null
}
################################################################################
# Autoscaling group - policy
################################################################################
variable "service_min_capacity" {
description = "Minimum capacity of ECS autoscaling target, cannot be more than max_capacity"
type = number
default = 1
}
variable "service_max_capacity" {
description = "Maximum capacity of ECS autoscaling target, cannot be less than min_capacity"
type = number
default = 4
}
variable "service_target_cpu_value" {
description = "Autoscale when CPU Usage value over the specified value. Must be specified if `enable_cpu_based_autoscaling` is `true`."
type = number
default = 70
}
variable "service_scale_in_cooldown" {
description = "Time between scale in action"
type = number
default = 300
}
variable "service_scale_out_cooldown" {
description = "Time between scale out action"
type = number
default = 300
}
variable "task_placement_constraints" {
description = "The rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10"
type = list(object({
type = string
expression = string
}))
default = []
}
variable "capacity_providers" {
description = "List of short names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT."
type = list(string)
default = []
}
variable "default_capacity_provider_strategy" {
description = "The capacity provider strategy to use by default for the cluster. Can be one or more."
type = list(map(any))
default = []
}