Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase minimum number of ECS service containers #10

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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