-
Notifications
You must be signed in to change notification settings - Fork 6
/
_variables.tf
223 lines (184 loc) · 6.27 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
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 "deployment_maximum_percent" {
default = "100"
description = "Deployment maximum percentage"
}
variable "deployment_minimum_healthy_percent" {
default = "0"
description = "Deployment minumum health percentage"
}
variable "desired_count" {
default = 1
description = "Number of containers (tasks) to run"
}
variable "cluster_name" {
default = "Name of existing ECS Cluster to deploy this app to"
}
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 "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 "log_subscription_filter_enabled" {
type = bool
default = false
description = "Enable cloudwatch log subscription filter"
}
variable "log_subscription_filter_role_arn" {
type = string
default = ""
description = "Role to use for log subscription filter (required when log_subscription_filter_enabled=true)"
}
variable "log_subscription_filter_destination_arn" {
type = string
default = ""
description = "Destination for log subscription filter (required when log_subscription_filter_enabled=true)"
}
variable "log_subscription_filter_filter_pattern" {
default = ""
type = string
description = "Filter pattern for log subscription filter"
}
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 = "EC2"
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 "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 "without_capacity_provider" {
default = false
description = "Launch service without capacity provider"
}
variable "task_role_policies_managed" {
default = []
description = "AWS Managed policies to be added on the task role."
}
variable "task_role_policies" {
default = []
description = "Custom policies to be added on the task role."
}
variable "autoscaling_cpu" {
default = false
description = "Enables autoscaling based on average CPU tracking"
}
variable "autoscaling_memory" {
default = false
description = "Enables autoscaling based on average Memory 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_target_memory" {
default = 90
description = "Target average Memory 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 "enable_schedule" {
default = false
description = "Enables schedule to shut down and start up instances outside business hours."
}
variable "autoscaling_custom" {
type = list(object({
name = string
scale_in_cooldown = number
scale_out_cooldown = number
target_value = number
metric_name = string
namespace = string
statistic = string
}))
default = []
description = "Set one or more app autoscaling by customized metric"
}
variable "schedule_cron_start" {
type = string
default = ""
description = "Cron expression to define when to trigger a start of the auto-scaling group. E.g. 'cron(00 21 ? * SUN-THU *)' to start at 8am UTC 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. 'cron(00 09 ? * MON-FRI *)' to start at 8am UTC time"
}
variable "tags" {
description = "A map of tags to add to service"
type = map(string)
default = {}
}