From 9d2d730205d4f82f366baacb544d3f757543d7c6 Mon Sep 17 00:00:00 2001 From: David Siaw Date: Thu, 7 Sep 2023 16:09:27 +0900 Subject: [PATCH] add exception if https does not exist --- app/models/backend/ecs/v2/service_stack.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/backend/ecs/v2/service_stack.rb b/app/models/backend/ecs/v2/service_stack.rb index 8382a328..dd1f273e 100644 --- a/app/models/backend/ecs/v2/service_stack.rb +++ b/app/models/backend/ecs/v2/service_stack.rb @@ -4,7 +4,11 @@ class Builder < CloudFormation::Builder def build_resources deps = [] if use_alb? - deps = ['LBListenerRuleHTTP', 'LBListenerRuleHTTPS'] + deps = ['LBListenerRuleHTTP'] + + if listener&.endpoint&.https_listener_id&.present? + deps << 'LBListenerRuleHTTPS' + end end add_resource("AWS::ECS::Service", "ECSService", { depends_on: deps }) do |j| j.Cluster district.name