From 3dc3b14ed1cbcc2918ce432e0ba6650767c7f14b Mon Sep 17 00:00:00 2001 From: David Wilkie Date: Wed, 23 Aug 2023 12:00:53 +0700 Subject: [PATCH] Add placement constraints for single instance services --- infrastructure/modules/somleng_switch/client_gateway.tf | 4 ++++ infrastructure/modules/somleng_switch/media_proxy.tf | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/infrastructure/modules/somleng_switch/client_gateway.tf b/infrastructure/modules/somleng_switch/client_gateway.tf index 2d9dd20d4..f29a1e4ae 100644 --- a/infrastructure/modules/somleng_switch/client_gateway.tf +++ b/infrastructure/modules/somleng_switch/client_gateway.tf @@ -214,6 +214,10 @@ resource "aws_ecs_service" "client_gateway" { weight = 1 } + placement_constraints { + type = "distinctInstance" + } + depends_on = [ aws_iam_role.client_gateway_task_execution_role ] diff --git a/infrastructure/modules/somleng_switch/media_proxy.tf b/infrastructure/modules/somleng_switch/media_proxy.tf index ddc39b1ae..d13d18db7 100644 --- a/infrastructure/modules/somleng_switch/media_proxy.tf +++ b/infrastructure/modules/somleng_switch/media_proxy.tf @@ -178,6 +178,10 @@ resource "aws_ecs_service" "media_proxy" { weight = 1 } + placement_constraints { + type = "distinctInstance" + } + depends_on = [ aws_iam_role.media_proxy_task_execution_role ]