Skip to content

Commit 265ecbf

Browse files
committed
Fixing error in variable definition
1 parent 6de9c16 commit 265ecbf

File tree

2 files changed

+50
-32
lines changed

2 files changed

+50
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Check versions for this module on:
1717

1818
module "td" {
1919
source = "cn-terraform/ecs-fargate-task-definition/aws"
20-
version = "1.0.6"
20+
version = "1.0.7"
2121
name_preffix = var.name_preffix
2222
profile = var.profile
2323
region = var.region

variables.tf

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ variable "container_name" {
3232
}
3333

3434
variable "command" {
35-
type = list
35+
type = list(string)
3636
description = "(Optional) The command that is passed to the container"
37-
default = [""]
37+
default = null
3838
}
3939

4040
variable "container_cpu" {
@@ -44,9 +44,9 @@ variable "container_cpu" {
4444
}
4545

4646
variable "container_depends_on" {
47-
type = list
47+
type = list(string)
4848
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"
49-
default = []
49+
default = null
5050
}
5151

5252
variable "container_memory" {
@@ -62,9 +62,9 @@ variable "container_memory_reservation" {
6262
}
6363

6464
variable "dns_servers" {
65-
type = list
66-
description = "(Optional) Container DNS servers. This is a list of strings specifying the IP addresses of the DNS servers."
67-
default = []
65+
type = list(string)
66+
description = "(Optional) Container DNS servers. This is a list of strings specifying the IP addresses of the DNS servers"
67+
default = null
6868
}
6969

7070
variable "docker_labels" {
@@ -74,21 +74,24 @@ variable "docker_labels" {
7474
}
7575

7676
variable "entrypoint" {
77-
type = list
77+
type = list(string)
7878
description = "(Optional) The entry point that is passed to the container"
79-
default = [""]
79+
default = null
8080
}
8181

8282
variable "environment" {
83-
type = list
84-
description = "(Optional) The environment variables to pass to the container. This is a list of maps. Each map should contain `name` and `value`"
85-
default = []
83+
type = list(object({
84+
name = string
85+
value = string
86+
}))
87+
description = "(Optional) The environment variables to pass to the container. This is a list of maps"
88+
default = null
8689
}
8790

8891
variable "essential" {
89-
type = string
92+
type = bool
9093
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"
91-
default = "true"
94+
default = true
9295
}
9396

9497
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html
@@ -115,9 +118,9 @@ variable "healthcheck" {
115118
}
116119

117120
variable "links" {
118-
type = list
119-
description = "(Optional) List of container names this container can communicate with without port mappings."
120-
default = []
121+
type = list(string)
122+
description = "(Optional) List of container names this container can communicate with without port mappings"
123+
default = null
121124
}
122125

123126
# https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html
@@ -135,9 +138,12 @@ variable "log_configuration" {
135138
}
136139

137140
variable "mount_points" {
138-
type = list
141+
type = list(object({
142+
containerPath = string
143+
sourceVolume = string
144+
}))
139145
description = "(Optional) Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume`"
140-
default = []
146+
default = null
141147
}
142148

143149
locals {
@@ -149,11 +155,11 @@ locals {
149155
},
150156
]
151157
}
152-
158+
153159
variable "readonly_root_filesystem" {
154-
type = string
160+
type = bool
155161
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"
156-
default = "false"
162+
default = false
157163
}
158164

159165
variable "repository_credentials" {
@@ -163,9 +169,12 @@ variable "repository_credentials" {
163169
}
164170

165171
variable "secrets" {
166-
type = list
172+
type = list(object({
173+
name = string
174+
valueFrom = string
175+
}))
167176
description = "(Optional) The secrets to pass to the container. This is a list of maps"
168-
default = []
177+
default = null
169178
}
170179

171180
variable "start_timeout" {
@@ -180,31 +189,40 @@ variable "system_controls" {
180189
}
181190

182191
variable "stop_timeout" {
192+
type = number
183193
description = "(Optional) Timeout in seconds between sending SIGTERM and SIGKILL to container"
184194
default = 30
185195
}
186196

187197
variable "ulimits" {
188-
type = list
198+
type = list(object({
199+
name = string
200+
hardLimit = number
201+
softLimit = number
202+
}))
189203
description = "(Optional) Container ulimit settings. This is a list of maps, where each map should contain \"name\", \"hardLimit\" and \"softLimit\""
190-
default = []
204+
default = null
191205
}
192206

193207
variable "user" {
208+
type = string
194209
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"
195-
default = ""
210+
default = null
196211
}
197212

198213
variable "volumes_from" {
199-
type = list
200-
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)."
201-
default = []
214+
type = list(object({
215+
sourceContainer = string
216+
readOnly = bool
217+
}))
218+
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)"
219+
default = null
202220
}
203221

204222
variable "working_directory" {
205223
type = string
206224
description = "(Optional) The working directory to run commands inside the container"
207-
default = ""
225+
default = null
208226
}
209227

210228
# ---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)