Skip to content

Commit

Permalink
feat: Add register_task_definition input
Browse files Browse the repository at this point in the history
Provides a flag for specifying whether to create the ECS Task Definition
or not.
  • Loading branch information
jasonwalsh authored and jasonwalsh committed Apr 11, 2019
1 parent 7b7575e commit 430b1bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,6 @@ resource "aws_ecs_task_definition" "ecs_task_definition" {
requires_compatibilities = "${var.requires_compatibilities}"
task_role_arn = "${var.task_role_arn}"
volume = "${var.volumes}"

count = "${var.register_task_definition ? 1 : 0}"
}
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "arn" {
description = "The full Amazon Resource Name (ARN) of the task definition"
value = "${aws_ecs_task_definition.ecs_task_definition.arn}"
value = "${join("", aws_ecs_task_definition.ecs_task_definition.*.arn)}"
}

output "container_definitions" {
Expand All @@ -10,10 +10,10 @@ output "container_definitions" {

output "family" {
description = "The family of your task definition, used as the definition name"
value = "${aws_ecs_task_definition.ecs_task_definition.family}"
value = "${join("", aws_ecs_task_definition.ecs_task_definition.*.family)}"
}

output "revision" {
description = "The revision of the task in a particular family"
value = "${aws_ecs_task_definition.ecs_task_definition.revision}"
value = "${join("", aws_ecs_task_definition.ecs_task_definition.*.revision)}"
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ variable "readonlyRootFilesystem" {
description = "When this parameter is true, the container is given read-only access to its root file system"
}

variable "register_task_definition" {
default = true
description = "Registers a new task definition from the supplied family and containerDefinitions"
}

variable "repositoryCredentials" {
default = {}
description = "The private repository authentication credentials to use"
Expand Down

0 comments on commit 430b1bf

Please sign in to comment.