Skip to content

Commit

Permalink
Add health_check_grace_period_seconds var to aws_ecs_service (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valekse authored and artyom-gatalsky committed Apr 11, 2019
1 parent bb26c02 commit 531c416
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ EOF
| ecs\_cluster\_id | ID of existing ECS cluster (if want to attach service and etc to existing cluster) | string | `none` | no |
| environment | Environment name is used to identify resources | string | `env` | no |
| minimum\_service\_capacity | The number of instances of the task definition to place and keep running | string | `1` | no |
| health\_check\_grace\_period\_seconds | Seconds to ignore failing load balancer health checks on newly instantiated tasks | string | `30` | no |
| project | Project name is used to identify resources | string | `test` | no |
| service | Service name (will be used as family name in task definition) | string | `SuperService` | no |
| subnets | List of subnets where to run ECS Service | list | - | yes |
Expand Down
2 changes: 1 addition & 1 deletion ecs-cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "aws_ecs_service" "this" {
deployment_minimum_healthy_percent = "100"

desired_count = "${var.minimum_service_capacity}"
health_check_grace_period_seconds = "30"
health_check_grace_period_seconds = "${var.health_check_grace_period_seconds}"

network_configuration {
subnets = ["${var.subnets}"]
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ variable "minimum_service_capacity" {
default = "1"
}

variable "health_check_grace_period_seconds" {
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown"
default = "30"
}

variable "container_definitions" {
description = "Fargate container definition"

Expand Down

0 comments on commit 531c416

Please sign in to comment.