Skip to content

Commit e5c782f

Browse files
author
Sumit Sarkar
committed
FEAT: Enable defining order_placement_strategy and task_placement_strategies
1 parent bb2e3ad commit e5c782f

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

main.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ resource "aws_ecs_service" "main" {
1818
deployment_minimum_healthy_percent = "${var.deployment_min_healthy_percent}"
1919
deployment_maximum_percent = "${var.deployment_max_percent}"
2020

21-
ordered_placement_strategy = {
22-
type = "spread"
23-
field = "instanceId"
24-
}
21+
ordered_placement_strategy = ["${var.ordered_placement_strategies}"]
22+
placement_constraints = ["${var.placement_constraints}"]
2523

2624
load_balancer {
2725
target_group_arn = "${aws_alb_target_group.main.id}"

variables.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,17 @@ variable "scale_down_cooldown_seconds" {
105105
default = 60
106106
description = "Number of seconds after the alarm that the scale DOWN should happen."
107107
}
108+
109+
variable "ordered_placement_strategies" {
110+
type = "list"
111+
default = [{
112+
type = "spread"
113+
}]
114+
}
115+
116+
variable "placement_constraints" {
117+
type = "list"
118+
default = [{
119+
type = "distinctInstance"
120+
}]
121+
}

0 commit comments

Comments
 (0)