From df56bb5da0f1b954e4456e89349f8809274c8b6c Mon Sep 17 00:00:00 2001 From: George Taylor Date: Tue, 12 Mar 2024 20:26:27 +0000 Subject: [PATCH] add task cpu/mem --- service/task_def.tf | 6 ++++++ service/variables.tf | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/service/task_def.tf b/service/task_def.tf index 8587e5b..aaa1ff7 100644 --- a/service/task_def.tf +++ b/service/task_def.tf @@ -8,6 +8,9 @@ resource "aws_ecs_task_definition" "default" { network_mode = "awsvpc" + task_cpu = var.task_cpu + task_memory = var.task_memory + dynamic "volume" { for_each = var.efs_volumes content { @@ -47,6 +50,9 @@ resource "aws_ecs_task_definition" "ignore_changes" { network_mode = "awsvpc" + task_cpu = var.task_cpu + task_memory = var.task_memory + ephemeral_storage { size_in_gib = var.ephemeral_storage_size_in_gib } diff --git a/service/variables.tf b/service/variables.tf index 46d053c..7858332 100644 --- a/service/variables.tf +++ b/service/variables.tf @@ -112,3 +112,15 @@ variable "ephemeral_storage_size_in_gib" { description = "The size of the ephemeral storage to use for the task definition" default = 30 } + +variable "task_cpu" { + type = string + description = "The amount of CPU to use for the task definition" + default = "256" +} + +variable "task_memory" { + type = string + description = "The amount of memory to use for the task definition" + default = "512" +}