Skip to content

Commit 18c41c8

Browse files
committed
Adding health_check_grace_period_seconds variable.
1 parent 7b3259e commit 18c41c8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

terraform/modules/service/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ resource "aws_ecs_service" "this" {
8888
}
8989

9090
deployment_minimum_healthy_percent = 100
91-
health_check_grace_period_seconds = 300
91+
health_check_grace_period_seconds = var.health_check_grace_period_seconds
9292
}
9393

9494
data "aws_iam_policy_document" "execution" {

terraform/modules/service/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ variable "cpu" {
2626
type = number
2727
}
2828

29+
variable "health_check_grace_period_seconds" {
30+
default = 300
31+
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers."
32+
type = number
33+
}
34+
2935
# reference: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size
3036
variable "memory" {
3137
description = "Amount (in MiB) of memory used by the task."

0 commit comments

Comments
 (0)