From 6925ee1c8157c9c8b19b071ba2038acd37c45373 Mon Sep 17 00:00:00 2001 From: johncookch Date: Fri, 6 Sep 2024 11:08:32 +0100 Subject: [PATCH] DSND-3059: Increase resources and tasks --- terraform/groups/ecs-service/main.tf | 1 + .../profiles/live-eu-west-2/live/vars | 5 +++++ .../profiles/staging-eu-west-2/staging/vars | 4 ++++ terraform/groups/ecs-service/variables.tf | 16 ++++++++++------ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/terraform/groups/ecs-service/main.tf b/terraform/groups/ecs-service/main.tf index aed9407b..231f1886 100644 --- a/terraform/groups/ecs-service/main.tf +++ b/terraform/groups/ecs-service/main.tf @@ -64,6 +64,7 @@ module "ecs-service" { # Service performance and scaling configs desired_task_count = var.desired_task_count max_task_count = var.max_task_count + min_task_count = var.min_task_count required_cpus = var.required_cpus required_memory = var.required_memory service_autoscale_enabled = var.service_autoscale_enabled diff --git a/terraform/groups/ecs-service/profiles/live-eu-west-2/live/vars b/terraform/groups/ecs-service/profiles/live-eu-west-2/live/vars index 451f6f20..d1fc11c2 100644 --- a/terraform/groups/ecs-service/profiles/live-eu-west-2/live/vars +++ b/terraform/groups/ecs-service/profiles/live-eu-west-2/live/vars @@ -4,3 +4,8 @@ aws_profile = "live-eu-west-2" # service configs use_set_environment_files = true log_level = "trace" + +min_task_count = 5 +desired_task_count = 5 +required_cpus = 768 +required_memory = 1536 \ No newline at end of file diff --git a/terraform/groups/ecs-service/profiles/staging-eu-west-2/staging/vars b/terraform/groups/ecs-service/profiles/staging-eu-west-2/staging/vars index c06e5bfd..f01e9ea4 100644 --- a/terraform/groups/ecs-service/profiles/staging-eu-west-2/staging/vars +++ b/terraform/groups/ecs-service/profiles/staging-eu-west-2/staging/vars @@ -5,6 +5,10 @@ aws_profile = "staging-eu-west-2" use_set_environment_files = true log_level = "trace" +desired_task_count = 2 +required_cpus = 768 +required_memory = 1536 + # Scheduled scaling of tasks service_autoscale_enabled = true service_scaledown_schedule = "55 19 * * ? *" diff --git a/terraform/groups/ecs-service/variables.tf b/terraform/groups/ecs-service/variables.tf index f02d2c4b..6c98463c 100644 --- a/terraform/groups/ecs-service/variables.tf +++ b/terraform/groups/ecs-service/variables.tf @@ -32,6 +32,16 @@ variable "desired_task_count" { description = "The desired ECS task count for this service" default = 1 # defaulted low for dev environments, override for production } +variable "max_task_count" { + type = number + description = "The maximum number of tasks for this service." + default = 10 +} +variable "min_task_count" { + type = number + description = "The minimum number of tasks for this service." + default = 1 +} variable "required_cpus" { type = number description = "The required cpu resource for this service. 1024 here is 1 vCPU" @@ -53,12 +63,6 @@ variable "eric_memory" { default = 512 } -variable "max_task_count" { - type = number - description = "The maximum number of tasks for this service." - default = 10 -} - variable "use_fargate" { type = bool description = "If true, sets the required capabilities for all containers in the task definition to use FARGATE, false uses EC2"