From cd23957ff56297eaa9ab5e5dbfe0dade7052aacc Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Fri, 28 Jun 2019 11:41:41 +0100 Subject: [PATCH] (Feature) Allow setting deployment minimum healthy percent --- main.tf | 4 ++++ variables.tf | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/main.tf b/main.tf index 7a90489..770f243 100644 --- a/main.tf +++ b/main.tf @@ -19,6 +19,8 @@ resource "aws_ecs_service" "main" { cluster = "${var.ecs_cluster_id}" task_definition = "${aws_ecs_task_definition.main.arn}" + deployment_minimum_healthy_percent = "${var.deployment_minimum_healthy_percent}" + health_check_grace_period_seconds = 30 load_balancer { @@ -39,6 +41,8 @@ resource "aws_ecs_service" "main_awsvpc" { cluster = "${var.ecs_cluster_id}" task_definition = "${aws_ecs_task_definition.main.arn}" + deployment_minimum_healthy_percent = "${var.deployment_minimum_healthy_percent}" + health_check_grace_period_seconds = 30 load_balancer { diff --git a/variables.tf b/variables.tf index 26a7427..9dedeb0 100644 --- a/variables.tf +++ b/variables.tf @@ -85,3 +85,9 @@ variable "container_port" { type = "string" default = "" } + +variable "deployment_minimum_healthy_percent" { + description = "The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment." + type = "string" + default = "50" +}