forked from Rishang/terraform-aws-fargate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
214 lines (171 loc) · 5.33 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
# ----- Environment ---------------
variable "EnvironmentName" {
type = string
description = "The name of the infra environment to deploy to eg. dev, prod, test"
}
variable "tags" {
type = map(any)
description = "Tags to apply to the resources"
default = {}
}
# ---------------------------- ECS Fargate --------------------------------
variable "task_definition_arn" {
type = string
description = "The ARN of the task definition to use for the ECS service"
}
variable "cluster" {
description = "The name of the cluster that hosts the service"
}
variable "service" {
description = "Fargate service name"
}
variable "fargate_spot" {
type = bool
description = "Whether to use fargate spot instances or not."
default = false
}
variable "force_spot" {
type = bool
description = "Set only fargate spot as Capacity provider."
default = true
}
variable "assign_public_ip" {
type = bool
description = "Auto assign public ip for ecs containers"
default = false
}
variable "force_new_deployment" {
type = bool
description = "Enable to force a new task deployment of the service"
default = false
}
variable "security_groups" {
type = list(string)
description = "Extra security groups to attach to ecs service"
default = []
}
variable "enable_ecs_managed_tags" {
type = bool
description = "Specifies whether to enable Amazon ECS managed tags for the service."
default = false
}
variable "deployment_minimum_healthy_percent" {
type = number
description = "Deployment min healthy percent of container count"
default = 100
}
variable "deployment_maximum_percent" {
type = number
description = "Deployment max healthy percent of container count"
default = 200
}
# ----------------------- Fargate autoscale -------------------------------
variable "min_count" {
type = number
description = "Min count of containers"
default = 1
}
variable "scale_max_capacity" {
type = number
description = "Max count of containers"
default = 20
}
variable "cpu_scale_target" {
type = number
description = "Treshold cpu target value for autoscaling ecs service"
default = -1
}
variable "memory_scale_target" {
type = number
description = "Treshold memory target value for autoscaling ecs service"
default = -1
}
variable "lb_scale_target" {
type = number
description = "Treshold target requests traffic value from alb, for autoscaling ecs service"
default = -1
}
variable "scale_in_cooldown" {
type = number
description = "The amount of time, in sec, after a scale in activity completes before another scale in activity can start."
default = 250
}
variable "scale_out_cooldown" {
type = number
description = "The amount of time, in sec, after a scale out activity completes before another scale in activity can start."
default = 250
}
# ----------------------- ROUTE 53 ----------------------------------------
variable "point_to_r53" {
type = bool
description = "Enable to point to R53"
default = false
}
variable "subdomain" {
type = string
description = "Subdomain name you want to give eg: test.example.com (required if 'point_to_r53' is true)"
default = ""
}
# -------------------------------- VPC ---------------------------------
variable "vpc_id" {
type = string
description = "aws vpc id"
default = ""
}
variable "subnets" {
type = list(string)
description = "List of subnets for ecs service"
}
# ------------------------------- ALB -----------------------------------
variable "point_to_lb" {
type = bool
description = "Enable to point to ALB (load balancer)"
default = false
}
variable "health_check_matcher" {
type = string
description = "Service health check response matcher"
default = "200,202"
}
variable "health_check_interval" {
type = number
description = "target group health check interval time in sec"
default = 20
}
variable "listener_arn_https" {
type = string
description = "HTTPS listner arn for Application Load Balencer (required if 'point_to_lb' is true)"
default = ""
}
variable "health_check_path" {
type = string
description = "Health check path for ecs running containers"
default = "/"
}
variable "path_pattern" {
type = list(string)
description = "List of paths for alb to route traffic at ecs target group"
default = ["/", "/*"]
}
# --------------------- SERVICE DISCOVERY ---------------------------------
variable "enable_discovery" {
type = bool
description = "Enable service discovery, requires `namespace_id` and `container_name`"
default = false
}
variable "namespace_id" {
type = string
description = "Namespace id (private) for service discovery, Note: discovery endpoint's subdomain will be same as service name"
default = ""
}
# --------------------- OTHERS ---------------------------------------------
variable "container_port" {
type = number
description = "container application port"
default = -1
}
variable "container_name" {
type = string
description = "Required if service name is different than main application container_name of task defination"
default = ""
}