From 370fb3231f8fb81090c05f894d8ec98a492c8b37 Mon Sep 17 00:00:00 2001 From: David Siaw Date: Thu, 31 Aug 2023 13:38:54 +0900 Subject: [PATCH] attempt to order resource build order for reviewapps --- app/models/backend/ecs/v2/service_stack.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/backend/ecs/v2/service_stack.rb b/app/models/backend/ecs/v2/service_stack.rb index 65bcb77e..b046dee7 100644 --- a/app/models/backend/ecs/v2/service_stack.rb +++ b/app/models/backend/ecs/v2/service_stack.rb @@ -2,7 +2,12 @@ module Backend::Ecs::V2 class ServiceStack < CloudFormation::Stack class Builder < CloudFormation::Builder def build_resources - add_resource("AWS::ECS::Service", "ECSService") do |j| + deps = [] + if use_alb? + deps = ['LBListenerRuleHTTP', 'LBListenerRuleHTTPS'] + end + + add_resource("AWS::ECS::Service", "ECSService", { depends_on: deps }) do |j| j.Cluster district.name j.TaskDefinition options[:task_definition] j.DesiredCount options[:desired_count]