From 9f721c7cbc98fa1feea551ec486382e46cbce4c7 Mon Sep 17 00:00:00 2001 From: MOSES BALAJI Date: Tue, 2 Jan 2024 17:24:35 +0800 Subject: [PATCH] Adding the task placement constraint in the main.tf for ecs service creation --- main.tf | 1 + variables.tf | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/main.tf b/main.tf index 655f92b..5ab2c0d 100644 --- a/main.tf +++ b/main.tf @@ -69,6 +69,7 @@ module "service" { assign_public_ip = var.assign_public_ip enable_execute_command = var.enable_execute_command + task_placement_constraints = each.value.task_placement_constraints } module "service_cpu_autoscaling_policy" { diff --git a/variables.tf b/variables.tf index 7ee300c..882ac20 100644 --- a/variables.tf +++ b/variables.tf @@ -268,3 +268,12 @@ variable "service_scale_out_cooldown" { type = number default = 300 } + +variable "task_placement_constraints" { + description = "The rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10" + type = list(object({ + type = string + expression = string + })) + default = [] +}