Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dependsOn #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions examples/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ locals {
entryPoint = jsonencode(var.entryPoint)
environment = jsonencode(var.environment)
extraHosts = jsonencode(var.extraHosts)
dependsOn = jsonencode(var.dependsOn)

healthCheck = replace(jsonencode(var.healthCheck), local.classes["digit"], "$1")

Expand Down Expand Up @@ -125,6 +126,7 @@ data "template_file" "container_definition" {
user = var.user == "" ? "null" : var.user
volumesFrom = local.volumesFrom == "[]" ? "null" : local.volumesFrom
workingDirectory = var.workingDirectory == "" ? "null" : var.workingDirectory
dependsOn = local.dependsOn == "[]" ? "null" : local.dependsOn
}
}

Expand Down
3 changes: 2 additions & 1 deletion templates/container-definition.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"ulimits": ${ulimits},
"user": "${user}",
"volumesFrom": ${volumesFrom},
"workingDirectory": "${workingDirectory}"
"workingDirectory": "${workingDirectory}",
"dependsOn": ${dependsOn}
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,9 @@ variable "workingDirectory" {
default = ""
description = "The working directory in which to run commands inside the container"
}

variable "dependsOn" {
default = []
description = "The list of port mappings for the container"
type = list(any)
}