Skip to content

Commit

Permalink
Adding the task placement constraint in the main.tf for ecs service c…
Browse files Browse the repository at this point in the history
…reation
  • Loading branch information
balajimoses committed Jan 2, 2024
1 parent 50b9d5d commit 9f721c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
}

0 comments on commit 9f721c7

Please sign in to comment.