Skip to content

Commit 49edaae

Browse files
committed
Updating dependencies
1 parent 2b2de4a commit 49edaae

File tree

2 files changed

+153
-86
lines changed

2 files changed

+153
-86
lines changed

main.tf

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,42 @@ module "container_definition" {
2323
container_image = var.container_image
2424
container_memory = var.container_memory
2525
container_memory_reservation = var.container_memory_reservation
26-
# container_definition = var.container_definition
27-
port_mappings = var.port_mappings
28-
healthcheck = var.healthcheck
29-
container_cpu = var.container_cpu
30-
essential = var.essential
31-
entrypoint = var.entrypoint
32-
command = var.command
33-
working_directory = var.working_directory
34-
environment = var.environment
35-
# extra_hosts = var.extra_hosts
36-
# map_environment = var.map_environment
37-
# environment_files = var.environment_files
38-
secrets = var.secrets
39-
readonly_root_filesystem = var.readonly_root_filesystem
40-
linux_parameters = var.linux_parameters
41-
log_configuration = var.log_configuration
42-
firelens_configuration = var.firelens_configuration
43-
mount_points = var.mount_points
44-
dns_servers = var.dns_servers
45-
# dns_search_domains = var.dns_search_domains
46-
ulimits = var.ulimits
47-
repository_credentials = var.repository_credentials
48-
volumes_from = var.volumes_from
49-
links = var.links
50-
user = var.user
51-
container_depends_on = var.container_depends_on
52-
docker_labels = var.docker_labels
53-
start_timeout = var.start_timeout
54-
stop_timeout = var.stop_timeout
55-
# privileged = var.
56-
system_controls = var.system_controls
57-
# hostname = var.hostname
58-
# disable_networking = var.disable_networking
59-
# interactive = var.interactive
60-
# pseudo_terminal = var.pseudo_terminal
61-
# docker_security_options = var.docker_security_options
26+
container_definition = var.container_definition
27+
port_mappings = var.port_mappings
28+
healthcheck = var.healthcheck
29+
container_cpu = var.container_cpu
30+
essential = var.essential
31+
entrypoint = var.entrypoint
32+
command = var.command
33+
working_directory = var.working_directory
34+
environment = var.environment
35+
extra_hosts = var.extra_hosts
36+
map_environment = var.map_environment
37+
environment_files = var.environment_files
38+
secrets = var.secrets
39+
readonly_root_filesystem = var.readonly_root_filesystem
40+
linux_parameters = var.linux_parameters
41+
log_configuration = var.log_configuration
42+
firelens_configuration = var.firelens_configuration
43+
mount_points = var.mount_points
44+
dns_servers = var.dns_servers
45+
dns_search_domains = var.dns_search_domains
46+
ulimits = var.ulimits
47+
repository_credentials = var.repository_credentials
48+
volumes_from = var.volumes_from
49+
links = var.links
50+
user = var.user
51+
container_depends_on = var.container_depends_on
52+
docker_labels = var.docker_labels
53+
start_timeout = var.start_timeout
54+
stop_timeout = var.stop_timeout
55+
privileged = var.privileged
56+
system_controls = var.system_controls
57+
hostname = var.hostname
58+
disable_networking = var.disable_networking
59+
interactive = var.interactive
60+
pseudo_terminal = var.pseudo_terminal
61+
docker_security_options = var.docker_security_options
6262
}
6363

6464
# Task Definition

variables.tf

Lines changed: 117 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,33 @@ variable "name_prefix" {
1111

1212

1313
variable "container_name" {
14+
type = string
1415
description = "The name of the container. Up to 255 characters ([a-z], [A-Z], [0-9], -, _ allowed)"
1516
}
1617

1718
variable "container_image" {
18-
description = "The image used to start the container."
19+
type = string
20+
description = "The image used to start the container. Images in the Docker Hub registry available by default"
1921
}
2022

2123
variable "container_memory" {
22-
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
24+
type = number
2325
description = "(Optional) The amount of memory (in MiB) to allow the container to use. This is a hard limit, if the container attempts to exceed the container_memory, the container is killed. This field is optional for Fargate launch type and the total amount of container_memory of all containers in a task will need to be lower than the task memory value"
24-
default = 8192 # 8 GB
26+
default = 4096 # 4 GB
2527
}
2628

2729
variable "container_memory_reservation" {
28-
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
30+
type = number
2931
description = "(Optional) The amount of memory (in MiB) to reserve for the container. If container needs to exceed this threshold, it can do so up to the set container_memory hard limit"
3032
default = 2048 # 2 GB
3133
}
3234

35+
variable "container_definition" {
36+
type = map
37+
description = "Container definition overrides which allows for extra keys or overriding existing keys."
38+
default = {}
39+
}
40+
3341
variable "port_mappings" {
3442
description = "The port mappings to configure for the container. This is a list of maps. Each map should contain \"containerPort\", \"hostPort\", and \"protocol\", where \"protocol\" is one of \"tcp\" or \"udp\". If using containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort"
3543
type = list(object({
@@ -61,61 +69,86 @@ variable "healthcheck" {
6169

6270
variable "container_cpu" {
6371
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
72+
type = number
6473
description = "(Optional) The number of cpu units to reserve for the container. This is optional for tasks using Fargate launch type and the total amount of container_cpu of all containers in a task will need to be lower than the task-level cpu value"
6574
default = 1024 # 1 vCPU
6675
}
6776

6877
variable "essential" {
69-
description = "(Optional) Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value"
7078
type = bool
79+
description = "Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value"
7180
default = true
7281
}
7382

7483
variable "entrypoint" {
75-
description = "(Optional) The entry point that is passed to the container"
7684
type = list(string)
85+
description = "The entry point that is passed to the container"
7786
default = null
7887
}
7988

8089
variable "command" {
81-
description = "(Optional) The command that is passed to the container"
8290
type = list(string)
91+
description = "The command that is passed to the container"
8392
default = null
8493
}
8594

8695
variable "working_directory" {
87-
description = "(Optional) The working directory to run commands inside the container"
8896
type = string
97+
description = "The working directory to run commands inside the container"
8998
default = null
9099
}
91100

92101
variable "environment" {
93-
description = "(Optional) The environment variables to pass to the container. This is a list of maps"
94102
type = list(object({
95103
name = string
96104
value = string
97105
}))
98-
default = []
106+
description = "The environment variables to pass to the container. This is a list of maps. map_environment overrides environment"
107+
default = []
108+
}
109+
110+
variable "extra_hosts" {
111+
type = list(object({
112+
ipAddress = string
113+
hostname = string
114+
}))
115+
description = "A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. This is a list of maps"
116+
default = null
117+
}
118+
119+
variable "map_environment" {
120+
type = map(string)
121+
description = "The environment variables to pass to the container. This is a map of string: {key: value}. map_environment overrides environment"
122+
default = null
123+
}
124+
125+
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_EnvironmentFile.html
126+
variable "environment_files" {
127+
type = list(object({
128+
value = string
129+
type = string
130+
}))
131+
description = "One or more files containing the environment variables to pass to the container. This maps to the --env-file option to docker run. The file must be hosted in Amazon S3. This option is only available to tasks using the EC2 launch type. This is a list of maps"
132+
default = null
99133
}
100134

101135
variable "secrets" {
102-
description = "(Optional) The secrets to pass to the container. This is a list of maps"
103136
type = list(object({
104137
name = string
105138
valueFrom = string
106139
}))
107-
default = null
140+
description = "The secrets to pass to the container. This is a list of maps"
141+
default = null
108142
}
109143

110144
variable "readonly_root_filesystem" {
111-
description = "(Optional) Determines whether a container is given read-only access to its root filesystem. Due to how Terraform type casts booleans in json it is required to double quote this value"
112145
type = bool
146+
description = "Determines whether a container is given read-only access to its root filesystem. Due to how Terraform type casts booleans in json it is required to double quote this value"
113147
default = false
114148
}
115149

116150
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html
117151
variable "linux_parameters" {
118-
description = "Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html"
119152
type = object({
120153
capabilities = object({
121154
add = list(string)
@@ -136,115 +169,149 @@ variable "linux_parameters" {
136169
size = number
137170
}))
138171
})
139-
140-
default = null
172+
description = "Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html"
173+
default = null
141174
}
142175

143176
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html
144177
variable "log_configuration" {
145-
description = "(Optional) Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html"
146-
type = object({
147-
logDriver = string
148-
options = map(string)
149-
secretOptions = list(object({
150-
name = string
151-
valueFrom = string
152-
}))
153-
})
154-
default = null
178+
type = any
179+
description = "Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html"
180+
default = null
155181
}
156182

157183
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html
158184
variable "firelens_configuration" {
159-
description = "(Optional) The FireLens configuration for the container. This is used to specify and configure a log router for container logs. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html"
160185
type = object({
161186
type = string
162187
options = map(string)
163188
})
164-
default = null
189+
description = "The FireLens configuration for the container. This is used to specify and configure a log router for container logs. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html"
190+
default = null
165191
}
166192

167193
variable "mount_points" {
168-
description = "(Optional) Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume`"
169-
type = list(object({
170-
containerPath = string
171-
sourceVolume = string
172-
}))
173-
default = []
194+
type = list
195+
196+
description = "Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume`. The `readOnly` key is optional."
197+
default = []
174198
}
175199

176200
variable "dns_servers" {
177201
type = list(string)
178-
description = "(Optional) Container DNS servers. This is a list of strings specifying the IP addresses of the DNS servers"
202+
description = "Container DNS servers. This is a list of strings specifying the IP addresses of the DNS servers"
203+
default = null
204+
}
205+
206+
variable "dns_search_domains" {
207+
type = list(string)
208+
description = "Container DNS search domains. A list of DNS search domains that are presented to the container"
179209
default = null
180210
}
181211

182212
variable "ulimits" {
183-
description = "(Optional) Container ulimit settings. This is a list of maps, where each map should contain \"name\", \"hardLimit\" and \"softLimit\""
184213
type = list(object({
185214
name = string
186215
hardLimit = number
187216
softLimit = number
188217
}))
189-
default = null
218+
description = "Container ulimit settings. This is a list of maps, where each map should contain \"name\", \"hardLimit\" and \"softLimit\""
219+
default = null
190220
}
191221

192222
variable "repository_credentials" {
193-
description = "(Optional) Container repository credentials; required when using a private repo. This map currently supports a single key; \"credentialsParameter\", which should be the ARN of a Secrets Manager's secret holding the credentials"
194223
type = map(string)
224+
description = "Container repository credentials; required when using a private repo. This map currently supports a single key; \"credentialsParameter\", which should be the ARN of a Secrets Manager's secret holding the credentials"
195225
default = null
196226
}
197227

198228
variable "volumes_from" {
199-
description = "(Optional) A list of VolumesFrom maps which contain \"sourceContainer\" (name of the container that has the volumes to mount) and \"readOnly\" (whether the container can write to the volume)"
200229
type = list(object({
201230
sourceContainer = string
202231
readOnly = bool
203232
}))
204-
default = null
233+
description = "A list of VolumesFrom maps which contain \"sourceContainer\" (name of the container that has the volumes to mount) and \"readOnly\" (whether the container can write to the volume)"
234+
default = []
205235
}
206236

207237
variable "links" {
208-
description = "(Optional) List of container names this container can communicate with without port mappings"
209238
type = list(string)
239+
description = "List of container names this container can communicate with without port mappings"
210240
default = null
211241
}
212242

213243
variable "user" {
214-
description = "(Optional) The user to run as inside the container. Can be any of these formats: user, user:group, uid, uid:gid, user:gid, uid:group"
215244
type = string
245+
description = "The user to run as inside the container. Can be any of these formats: user, user:group, uid, uid:gid, user:gid, uid:group. The default (null) will use the container's configured `USER` directive or root if not set."
216246
default = null
217247
}
218248

219249
variable "container_depends_on" {
220-
description = "(Optional) The dependencies defined for container startup and shutdown. A container can contain multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed"
221250
type = list(object({
222251
containerName = string
223252
condition = string
224253
}))
225-
default = null
254+
description = "The dependencies defined for container startup and shutdown. A container can contain multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed. The condition can be one of START, COMPLETE, SUCCESS or HEALTHY"
255+
default = null
226256
}
227257

228258
variable "docker_labels" {
229-
description = "(Optional) The configuration options to send to the `docker_labels`"
230259
type = map(string)
260+
description = "The configuration options to send to the `docker_labels`"
231261
default = null
232262
}
233263

234264
variable "start_timeout" {
235-
description = "(Optional) Time duration (in seconds) to wait before giving up on resolving dependencies for a container."
236-
default = 30
265+
type = number
266+
description = "Time duration (in seconds) to wait before giving up on resolving dependencies for a container"
267+
default = null
237268
}
238269

239270
variable "stop_timeout" {
240-
description = "(Optional) Timeout in seconds between sending SIGTERM and SIGKILL to container"
241271
type = number
242-
default = 30
272+
description = "Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own"
273+
default = null
274+
}
275+
276+
variable "privileged" {
277+
type = bool
278+
description = "When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type."
279+
default = null
243280
}
244281

245282
variable "system_controls" {
246-
description = "(Optional) A list of namespaced kernel parameters to set in the container, mapping to the --sysctl option to docker run. This is a list of maps: { namespace = \"\", value = \"\"}"
247283
type = list(map(string))
284+
description = "A list of namespaced kernel parameters to set in the container, mapping to the --sysctl option to docker run. This is a list of maps: { namespace = \"\", value = \"\"}"
285+
default = null
286+
}
287+
288+
variable "hostname" {
289+
type = string
290+
description = "The hostname to use for your container."
291+
default = null
292+
}
293+
294+
variable "disable_networking" {
295+
type = bool
296+
description = "When this parameter is true, networking is disabled within the container."
297+
default = null
298+
}
299+
300+
variable "interactive" {
301+
type = bool
302+
description = "When this parameter is true, this allows you to deploy containerized applications that require stdin or a tty to be allocated."
303+
default = null
304+
}
305+
306+
variable "pseudo_terminal" {
307+
type = bool
308+
description = "When this parameter is true, a TTY is allocated. "
309+
default = null
310+
}
311+
312+
variable "docker_security_options" {
313+
type = list(string)
314+
description = "A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems."
248315
default = null
249316
}
250317

0 commit comments

Comments
 (0)