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 16, 2018
1 parent 52de572 commit c4bd43c
Show file tree
Hide file tree
Showing 4 changed files with 21 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 @@ -69,7 +69,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 @@ -84,7 +84,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 @@ -75,7 +75,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 @@ -90,7 +90,7 @@ resource "aws_ecs_service" "author" {
}

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

Expand Down
15 changes: 15 additions & 0 deletions global_vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,18 @@ variable "firebase_messaging_sender_id" {
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 @@ -70,7 +70,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 @@ -85,7 +85,7 @@ resource "aws_ecs_service" "publisher" {
}

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

Expand Down

0 comments on commit c4bd43c

Please sign in to comment.