forked from techservicesillinois/terraform-aws-ecs-service
-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
179 lines (149 loc) · 5.35 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
##########################################################################
# ECS/Fargate service configuration
##########################################################################
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html
#### Required
variable "name" {
description = "The name of the ECS service"
}
#### Optional
variable "task_definition" {
description = "Task definition block (map)"
type = map(any)
default = {}
}
variable "task_definition_arn" {
description = " The family and revision (family:revision) or full ARN of the task definition to run in the ECS service."
default = ""
}
variable "desired_count" {
description = "The number of instances of the task definition to place and keep running"
default = 1
}
variable "launch_type" {
description = "The launch type on which to run the service. The valid values are EC2 and FARGATE."
default = "FARGATE"
}
variable "cluster" {
description = "A name of an ECS cluster"
default = "default"
}
variable "deployment_maximum_percent" {
description = "The upper limit, as a percentage of the service's desired_count, of the number of running tasks that can be running in a service during a deployment."
default = 200
}
variable "deployment_minimum_healthy_percent" {
description = "The lower limit, as a percentage of the service's desired_count, of the number of running tasks that must remain running and healthy in a service during a deployment."
default = 50
}
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(string)
default = []
}
variable "health_check_grace_period_seconds" {
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 1800. Only valid for services configured to use load balancers."
default = 0
}
variable "load_balancer" {
description = "A load balancer block"
type = map(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(string)
default = []
}
variable "platform_version" {
# Applies to Fargate only.
description = "FARGATE platform version on which to run your service."
type = string
default = null
}
variable "network_configuration" {
description = "A network configuration block"
type = map(string)
default = {}
}
variable "service_discovery" {
description = "A service discovery block"
type = map(any)
default = {}
}
variable "service_discovery_health_check_config" {
description = "A service discovery health check config block"
type = map(string)
default = {}
}
variable "service_discovery_health_check_custom_config" {
description = "A service discovery health check custom config block"
type = map(string)
default = {}
}
##########################################################################
# additional load balancer configuration
##########################################################################
# stickiness MUST have a default otherwise Terraform will fail when
# the map is not defined!
variable "stickiness" {
description = "A stickiness block. Valid only with application load balancers"
type = map(any)
default = {
type = "lb_cookie"
enabled = false
}
}
variable "health_check" {
description = "A health check block."
type = map(string)
default = {}
}
##########################################################################
# additonal task default configuration
##########################################################################
variable "volume" {
description = "A list of volume blocks that containers in your task may use."
type = list(object({
name = string
host_path = string
docker_volume_configuration = object({
scope = string
autoprovision = bool
driver = string
driver_opts = map(string)
labels = map(string)
})
efs_volume_configuration = object({
file_system_id = string
root_directory = string
})
}))
default = []
}
##########################################################################
# misc definition
##########################################################################
variable "tags" {
description = "Tags to be applied to resources where supported"
type = map(string)
default = {}
}
##########################################################################
# Route 53 configuration
##########################################################################
variable "alias" {
description = "Route 53 alias block"
type = map(string)
default = {}
}
##########################################################################
# AutoScaling Configuration
##########################################################################
variable "autoscale" {
description = "An autoscale block"
type = map(string)
default = {}
}