-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvariables.tf
More file actions
223 lines (185 loc) · 6.41 KB
/
variables.tf
File metadata and controls
223 lines (185 loc) · 6.41 KB
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 "create" {
description = "Should resources be created"
default = true
type = bool
}
variable "role_arn" {
description = "The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services."
type = string
default = null
}
variable "execution_role_arn" {
description = <<-EOT
The ARN of IAM role that allows ECS to execute your task.
Required when:
- using `environment_parameters` to give ECS access to the SSM parameters
- using `launch_type = "FARGATE"` when running the task
EOT
type = string
default = null
}
variable "network_mode" {
description = <<-EOT
Docker networking mode to use for the containers in the task.
Valid values are `none`, `bridge`, `awsvpc`, and `host`.
EOT
type = string
default = null
}
variable "task_memory" {
description = "Memory reserved for the task. Required when running on Fargate."
type = number
default = null
}
variable "task_cpu" {
description = "CPU reserved for the task. Required when running on Fargate."
type = number
default = null
}
# log_group
variable "project" {
description = "Kebab-cased project name"
type = string
}
variable "environment" {
description = "Kebab-cased environment name, eg. development, staging, production."
type = string
}
variable "tags" {
description = "Tags to add to resources that support them"
type = map(string)
default = {}
}
variable "task" {
description = "ECS task definition name"
type = string
}
variable "container" {
description = "Container name within the task definition, defaults to task name"
type = string
default = null
}
variable "log_retention" {
description = <<EOF
Log retention in days.
Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653, and 0.
If you select 0, the events in the log group are always retained and never expire.
EOF
type = number
default = 7
}
# container_definition
variable "image" {
description = "Full container image name, including the version tag. Either image or image_name has to be provided."
type = string
default = null
}
variable "image_name" {
description = "Container image name, without the version tag. Either image or image_name has to be provided."
type = string
default = null
}
variable "image_tag" {
description = "Container image version tag, if omitted will use one from the latest revision. Used only when image_name is provided."
type = string
default = null
}
variable "memory_hard_limit" {
description = "The amount (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed."
type = number
default = 1024
}
variable "memory_soft_limit" {
description = "The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit; however, your container can consume more memory when needed."
type = number
default = 256
}
variable "ports" {
description = "List of TCP ports that should be exposed on the host, a random host port will be assigned for each container port"
type = list(number)
default = []
}
variable "cpu" {
description = "The number of cpu units (1/1024 vCPU) the Amazon ECS container agent will reserve for the container."
type = number
default = 0
}
variable "essential" {
description = "If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped."
type = bool
default = true
}
variable "entry_point" {
description = "Entry point override."
type = list(string)
default = null
}
variable "command" {
description = "Command override."
type = list(string)
default = null
}
variable "working_directory" {
description = "Working directory override."
type = string
default = null
}
variable "environment_variables" {
description = "Environment variables to pass to a container."
type = map(string)
default = {}
}
variable "environment_parameters" {
description = <<-EOT
Environment variables that should be set to Systems Manager parameter values.
Maps environment variable names to parameters.
EOT
type = map(object({
arn = string
version = number
}))
default = {}
}
variable "enable_environment_parameters_hash" {
description = <<-EOT
Inject an `SSM_PARAMETERS_HASH` environment variable to ensure that whenever parameter versions change the container definition will also change.
This makes sure that any services will be updated with new task definitions whenever a parameter is updated, so the service itself doesn't need to poll SSM.
EOT
type = bool
default = true
}
variable "placement_constraint_expressions" {
description = "Placement constraint expressions for the task in Cluster Query Language"
type = list(string)
default = []
}
variable "healthcheck_command" {
description = "Command that the container runs to determine if it is healthy"
type = string
default = null
}
variable "healthcheck_shell" {
description = "Whether the healthcheck_command should be run using a shell"
type = bool
default = true
}
variable "healthcheck_interval" {
description = "The time period in seconds between each health check execution. You may specify between 5 and 300 seconds."
type = number
default = 30
}
variable "healthcheck_retries" {
description = "The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries."
type = number
default = 2
}
variable "healthcheck_start_period" {
description = "The optional grace period to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. You can specify between 0 and 300 seconds."
type = number
default = 0
}
variable "healthcheck_timeout" {
description = "The time period in seconds to wait for a health check to succeed before it is considered a failure. You may specify between 2 and 60 seconds."
type = number
default = 5
}