-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path_variables.tf
289 lines (239 loc) · 7.68 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
variable "name" {
description = "Name of your ECS service"
}
variable "memory" {
default = "512"
description = "Hard memory of the container"
}
variable "cpu" {
default = "0"
description = "Hard limit for CPU for the container"
}
variable "cluster_name" {
default = "Name of existing ECS Cluster to deploy this app to"
}
variable "service_role_arn" {
description = "Existing service role ARN created by ECS cluster module"
}
variable "task_role_arn" {
description = "Existing task role ARN created by ECS cluster module"
}
variable "image" {
description = "Docker image to deploy (can be a placeholder)"
default = "dnxsolutions/nginx-hello:latest"
}
variable "vpc_id" {
description = "VPC ID to deploy this app to"
}
variable "alarm_sns_topics" {
default = []
description = "Alarm topics to create and alert on ECS service metrics"
}
variable "alarm_prefix" {
type = string
description = "String prefix for cloudwatch alarms. (Optional, leave blank to use iam_account_alias)"
default = ""
}
variable "nlb_arn" {
default = ""
description = "Networking LoadBalance ARN - Required if nlb=false or nlb_internal=false"
}
variable "port" {
default = "80"
description = "Port for target group to listen"
}
variable "ports" {
default = [
{
port = 80
protocol = "tcp"
}
]
description = "Port for target group to listen"
type = list(object({
port = number
protocol = string
}))
}
variable "container_port" {
default = "8080"
description = "Port your container listens (used in the placeholder task definition)"
}
variable "hostname_create" {
default = "true"
description = "Optional parameter to create or not a Route53 record"
}
variable "hosted_zone" {
default = ""
description = "Hosted Zone to create DNS record for this app"
}
variable "hostname" {
default = ""
description = "Hostname to create DNS record for this app"
}
variable "autoscaling_cpu" {
default = false
description = "Enables autoscaling based on average CPU tracking"
}
variable "autoscaling_max" {
default = 4
description = "Max number of containers to scale with autoscaling"
}
variable "autoscaling_min" {
default = 1
description = "Min number of containers to scale with autoscaling"
}
variable "autoscaling_target_cpu" {
default = 50
description = "Target average CPU percentage to track for autoscaling"
}
variable "autoscaling_scale_in_cooldown" {
default = 300
description = "Cooldown in seconds to wait between scale in events"
}
variable "autoscaling_scale_out_cooldown" {
default = 300
description = "Cooldown in seconds to wait between scale out events"
}
variable "service_health_check_grace_period_seconds" {
default = 0
description = "Time until your container starts serving requests"
}
variable "ordered_placement_strategy" {
# This variable may not be used with Fargate!
description = "Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. The maximum number of ordered_placement_strategy blocks is 5."
type = list(object({
field = string
expression = string
}))
default = []
}
variable "placement_constraints" {
# This variables may not be used with Fargate!
description = "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 "launch_type" {
default = "FARGATE"
description = "The launch type on which to run your service. The valid values are EC2 and FARGATE. Defaults to EC2."
}
variable "fargate_spot" {
default = false
description = "Set true to use FARGATE_SPOT capacity provider by default (only when launch_type=FARGATE)"
}
variable "subnets" {
default = null
description = "The subnets associated with the task or service. (REQUIRED IF 'LAUCH_TYPE' IS FARGATE)"
}
variable "nlb_subnets_ids" {
default = null
description = "The subnets associated with the task or service. (REQUIRED IF 'LAUCH_TYPE' IS FARGATE)"
}
variable "nlb_subnets_cidr" {
default = null
description = "The subnets associated with the task or service. (REQUIRED IF 'LAUCH_TYPE' IS FARGATE)"
}
variable "network_mode" {
default = null
description = "The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. (REQUIRED IF 'LAUCH_TYPE' IS FARGATE)"
}
variable "security_groups" {
default = null
description = "The security groups associated with the task or service"
}
variable "nlb_internal" {
default = false
type = bool
description = "Creates an Internal NLB for this service"
}
variable "nlb" {
default = false
type = bool
description = "Flag to create the NLB"
}
variable "assign_public_ip" {
default = false
type = bool
description = "Configures ECS Service to assign public IP (Fargate Only)"
}
variable "cloudwatch_logs_retention" {
default = 120
description = "Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653."
}
variable "cloudwatch_logs_export" {
default = false
description = "Whether to mark the log group to export to an S3 bucket (needs terraform-aws-log-exporter to be deployed in the account/region)"
}
variable "security_group_ecs_nodes_inbound_cidrs" {
type = list(string)
default = ["0.0.0.0/0"]
description = "ECS Nodes inbound allowed CIDRs for the security group."
}
variable "security_group_nlb_inbound_cidrs" {
type = list(string)
default = ["0.0.0.0/0"]
description = "NLB inbound allowed CIDRs for the security group."
}
variable "create_iam_codedeployrole" {
type = bool
default = true
description = "Create Codedeploy IAM Role for ECS or not."
}
variable "codedeploy_role_arn" {
default = null
description = "Existing IAM CodeDeploy role ARN created by ECS cluster module"
}
variable "efs_mapping" {
type = map(string)
description = "A map of efs volume ids and paths to mount into the default task definition"
default = {}
}
variable "ulimits" {
type = list(object({
name = string
hardLimit = number
softLimit = number
}))
description = "Container ulimit settings. This is a list of maps, where each map should contain \"name\", \"hardLimit\" and \"softLimit\""
default = null
}
variable "deployment_controller" {
default = "CODE_DEPLOY"
description = "Type of deployment controller. Valid values: CODE_DEPLOY, ECS, EXTERNAL."
}
variable "codedeploy_wait_time_for_cutover" {
default = 0
description = "Time in minutes to route the traffic to the new application deployment"
}
variable "codedeploy_wait_time_for_termination" {
default = 0
description = "Time in minutes to terminate the new deployment"
}
variable "codedeploy_deployment_config_name" {
default = "CodeDeployDefault.ECSAllAtOnce"
description = "Specifies the deployment configuration for CodeDeploy"
}
variable "enable_schedule" {
description = "Enable scheduling for ECS service"
type = bool
default = false
}
variable "schedule_cron_start" {
description = "Cron expression to start the ECS service"
type = string
default = ""
}
variable "schedule_cron_stop" {
description = "Cron expression to stop the ECS service"
type = string
default = ""
}
variable "schedule_timezone" {
description = "Timezone for the scheduled actions"
type = string
default = "UTC"
}