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" +}