Skip to content

Commit

Permalink
Add optional task_definition variable, use it if non-empty (#61)
Browse files Browse the repository at this point in the history
* Add optional task_definition variable, use it if non-empty

* Update main.tf

---------

Co-authored-by: Sadri Gargouri <[email protected]>
  • Loading branch information
larstobi and SadriG91 authored Mar 1, 2023
1 parent 0df2af7 commit dc462c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ resource "aws_ecs_service" "service" {
]
name = var.name_prefix
cluster = var.cluster_id
task_definition = aws_ecs_task_definition.task.arn
task_definition = var.task_definition != "" ? var.task_definition : aws_ecs_task_definition.task.arn
desired_count = var.desired_count
launch_type = "FARGATE"
deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ variable "task_container_protocol" {
type = string
}

variable "task_definition" {
description = "Provided task definition for the service."
default = ""
type = string
}

variable "task_definition_cpu" {
description = "Amount of CPU to reserve for the task."
default = 256
Expand Down

0 comments on commit dc462c0

Please sign in to comment.