Skip to content

Commit

Permalink
fix: max 1 replica
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Oct 17, 2023
1 parent 07eacf9 commit 9435350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions terraform/ecs/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ resource "aws_ecs_service" "app_service" {
task_definition = aws_ecs_task_definition.app_task.arn
launch_type = "FARGATE"
desired_count = var.autoscaling_desired_count
deployment_maximum_percent = 100 # guarantee no more than desired_count tasks are running at a time
propagate_tags = "TASK_DEFINITION"

# Wait for the service deployment to succeed
Expand Down
6 changes: 3 additions & 3 deletions terraform/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ variable "task_memory" {
variable "autoscaling_desired_count" {
description = "Minimum number of instances in the autoscaling group"
type = number
default = 2
default = 1
}

variable "autoscaling_min_capacity" {
description = "Minimum number of instances in the autoscaling group"
type = number
default = 2
default = 1
}

variable "autoscaling_max_capacity" {
description = "Maximum number of instances in the autoscaling group"
type = number
default = 8
default = 1
}

#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 9435350

Please sign in to comment.