Skip to content

Commit 40cf22a

Browse files
authored
Add secrets to task defintion (#28)
* Add secrets * fix variable naming * Fix variable type * Fix variable check * Fix for valid JSON
1 parent 81ced2e commit 40cf22a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ resource "aws_ecs_task_definition" "task" {
198198
%{if var.task_mount_points != null~}
199199
"mountPoints": ${jsonencode(var.task_mount_points)},
200200
%{~endif}
201+
%{if var.task_container_secrets != null~}
202+
"secrets": ${jsonencode(var.task_container_secrets)},
203+
%{~endif}
201204
"environment": ${jsonencode(local.task_environment)}
202205
}]
203206
EOF

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ variable "task_container_environment" {
9898
type = map(string)
9999
}
100100

101+
variable "task_container_secrets" {
102+
description = "The secrets variables to pass to a container."
103+
default = null
104+
type = list(map(string))
105+
}
106+
101107
variable "log_retention_in_days" {
102108
description = "Number of days the logs will be retained in CloudWatch."
103109
default = 30

0 commit comments

Comments
 (0)