Skip to content

Commit

Permalink
Allow customizing grace period time (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: dmattia <[email protected]>
  • Loading branch information
dmattia and dmattia authored Aug 9, 2020
1 parent 9215731 commit 0471c72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ resource "aws_ecs_service" "service" {
type = "ECS"
}

health_check_grace_period_seconds = length(var.load_balancers) > 0 ? 60 : 0
health_check_grace_period_seconds = var.health_check_grace_period_seconds


dynamic "load_balancer" {
for_each = var.load_balancers
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ variable additional_task_policy_arns_count {
default = 0
}

variable health_check_grace_period_seconds {
type = number
default = 60
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."
}

variable alb_security_group_ids {
type = list(string)
description = "The ids of all security groups set on the ALB. We require that the tasks can only talk to the ALB"
Expand Down

0 comments on commit 0471c72

Please sign in to comment.