From 9435350bca2564641a9a8c93fac12e9f9a1f008c Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 17 Oct 2023 19:34:58 -0400 Subject: [PATCH] fix: max 1 replica --- terraform/ecs/cluster.tf | 1 + terraform/ecs/variables.tf | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/terraform/ecs/cluster.tf b/terraform/ecs/cluster.tf index 4196364b..f4dc4fef 100644 --- a/terraform/ecs/cluster.tf +++ b/terraform/ecs/cluster.tf @@ -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 diff --git a/terraform/ecs/variables.tf b/terraform/ecs/variables.tf index 8d4dd01d..8d884a4b 100644 --- a/terraform/ecs/variables.tf +++ b/terraform/ecs/variables.tf @@ -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 } #-------------------------------------------------------------------------------