diff --git a/web-service/main.tf b/web-service/main.tf index 95b43db5..76d4d45c 100644 --- a/web-service/main.tf +++ b/web-service/main.tf @@ -143,6 +143,9 @@ resource "aws_ecs_service" "main" { deployment_minimum_healthy_percent = "${var.deployment_minimum_healthy_percent}" deployment_maximum_percent = "${var.deployment_maximum_percent}" + # Track the latest ACTIVE revision + task_definition = "${module.task.name}:${max("${module.task.revision}", "${data.aws_ecs_task_definition.task.revision}")}" + load_balancer { elb_name = "${module.elb.id}" container_name = "${module.task.name}" @@ -154,6 +157,10 @@ resource "aws_ecs_service" "main" { } } +data "aws_ecs_task_definition" "task" { + task_definition = "${module.task.name}" +} + module "task" { source = "../task"