Skip to content

Commit

Permalink
paratemerize task definition cpu and memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Tural Nasirov committed Jun 12, 2022
1 parent 55851ff commit 4878927
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ resource "aws_ecs_task_definition" "task_definition" {
network_mode = "awsvpc"
container_definitions = data.template_file.default-container.rendered
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
cpu = 512
memory = 2048
cpu = var.task_definition_cpu
memory = var.task_definition_memory
}


Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ variable "iam_role_additional_policies" {
default = []
}

variable "task_definition_cpu" {
description = "Task definition CPU"
type = number
default = 512
}

variable "task_definition_memory" {
description = "Task definition memory"
type = number
default = 2048
}

# Default container related variables
variable "default_container_cpu" {
description = "Default container cpu"
Expand Down

0 comments on commit 4878927

Please sign in to comment.