From 587347092a5195b386b806af9a320248e230b029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Tobias=20Skjong-B=C3=B8rsting?= Date: Wed, 11 Dec 2019 13:37:03 +0100 Subject: [PATCH] Added support for stop timeout --- main.tf | 1 + variables.tf | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/main.tf b/main.tf index 086e65b..cba1c74 100644 --- a/main.tf +++ b/main.tf @@ -157,6 +157,7 @@ resource "aws_ecs_task_definition" "task" { "awslogs-stream-prefix": "container" } }, + "stopTimeout": ${var.stop_timeout}, "command": ${jsonencode(var.task_container_command)}, "environment": ${jsonencode(local.task_environment)} }] diff --git a/variables.tf b/variables.tf index f4777fd..f24dc9d 100644 --- a/variables.tf +++ b/variables.tf @@ -143,3 +143,8 @@ variable "service_registry_arn" { description = "ARN of aws_service_discovery_service resource" type = string } + +variable "stop_timeout" { + description = "Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. On Fargate the maximum value is 120 seconds." + default = 30 +}