diff --git a/main.tf b/main.tf index 690ec20..b5ccf61 100644 --- a/main.tf +++ b/main.tf @@ -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 diff --git a/variables.tf b/variables.tf index f3f4c5f..242c181 100644 --- a/variables.tf +++ b/variables.tf @@ -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