Skip to content

Commit

Permalink
Increase minimum number of ECS service containers
Browse files Browse the repository at this point in the history
  • Loading branch information
dwyeradam committed Feb 15, 2018
1 parent 657a2a6 commit b7fce9e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions author-api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ resource "aws_ecs_service" "author-api" {
name = "${var.env}-author-api"
cluster = "${data.aws_ecs_cluster.ecs-cluster.id}"
task_definition = "${aws_ecs_task_definition.author-api.family}"
desired_count = "1"
desired_count = "${var.author_api_min_tasks}"
iam_role = "${aws_iam_role.author-api.arn}"

placement_strategy {
Expand All @@ -80,7 +80,7 @@ resource "aws_ecs_service" "author-api" {
}

lifecycle {
ignore_changes = ["placement_strategy"]
ignore_changes = ["placement_strategy", "desired_count"]
}
}

Expand Down
4 changes: 2 additions & 2 deletions author.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "aws_ecs_service" "author" {
name = "${var.env}-author"
cluster = "${data.aws_ecs_cluster.ecs-cluster.id}"
task_definition = "${aws_ecs_task_definition.author.family}"
desired_count = "1"
desired_count = "${var.author_min_tasks}"
iam_role = "${aws_iam_role.author.arn}"

placement_strategy {
Expand All @@ -86,7 +86,7 @@ resource "aws_ecs_service" "author" {
}

lifecycle {
ignore_changes = ["placement_strategy"]
ignore_changes = ["placement_strategy", "desired_count"]
}
}

Expand Down
14 changes: 14 additions & 0 deletions global_vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,17 @@ variable "schema_validator_url" {
description = "The URL for the schema validator service"
}

variable "author_min_tasks" {
description = "The minimum number of Author tasks to run"
default = "2"
}

variable "author_api_min_tasks" {
description = "The minimum number of Author API tasks to run"
default = "2"
}

variable "publisher_min_tasks" {
description = "The minimum number of Publisher tasks to run"
default = "2"
}
4 changes: 2 additions & 2 deletions publisher.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ resource "aws_ecs_service" "publisher" {
name = "${var.env}-publisher"
cluster = "${data.aws_ecs_cluster.ecs-cluster.id}"
task_definition = "${aws_ecs_task_definition.publisher.family}"
desired_count = "1"
desired_count = "${var.publisher_min_tasks}"
iam_role = "${aws_iam_role.publisher.arn}"

placement_strategy {
Expand All @@ -81,7 +81,7 @@ resource "aws_ecs_service" "publisher" {
}

lifecycle {
ignore_changes = ["placement_strategy"]
ignore_changes = ["placement_strategy", "desired_count"]
}
}

Expand Down

0 comments on commit b7fce9e

Please sign in to comment.