diff --git a/main.tf b/main.tf index 7b65724..d1a0e51 100644 --- a/main.tf +++ b/main.tf @@ -181,6 +181,7 @@ resource "aws_ecs_service" "default" { desired_count = "${var.desired_count}" deployment_maximum_percent = "${var.deployment_maximum_percent}" deployment_minimum_healthy_percent = "${var.deployment_minimum_healthy_percent}" + health_check_grace_period_seconds = "${var.health_check_grace_period_seconds}" launch_type = "${var.launch_type}" cluster = "${var.ecs_cluster_arn}" tags = "${module.default_label.tags}" diff --git a/variables.tf b/variables.tf index 332fed9..334248b 100644 --- a/variables.tf +++ b/variables.tf @@ -107,3 +107,9 @@ variable "deployment_minimum_healthy_percent" { description = "The lower limit (as a percentage of `desired_count`) of the number of tasks that must remain running and healthy in a service during a deployment" default = 100 } + +variable "health_check_grace_period_seconds" { + type = "string" + description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers." + default = 0 +}