From e456b8002048608f8e31fcb922f4916f5cc6683e Mon Sep 17 00:00:00 2001 From: David Siaw Date: Tue, 6 Feb 2024 14:29:28 +0900 Subject: [PATCH] do not add http rule for reviewapp --- app/models/backend/ecs/v2/service_stack.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/models/backend/ecs/v2/service_stack.rb b/app/models/backend/ecs/v2/service_stack.rb index d253db05..4ea3139f 100644 --- a/app/models/backend/ecs/v2/service_stack.rb +++ b/app/models/backend/ecs/v2/service_stack.rb @@ -183,11 +183,13 @@ def build_classic_elb end def build_alb_listener - add_resource("AWS::ElasticLoadBalancingV2::ListenerRule", "LBListenerRuleHTTP") do |j| - j.Actions [{"TargetGroupArn" => ref("LBTargetGroup1"), "Type" => "forward"}] - j.Conditions(listener.rule_conditions.map { |c| {"Field" => c["type"], "Values" => [c["value"]]} }) - j.ListenerArn listener.endpoint.http_listener_id - j.Priority listener.rule_priority + if !service&.heritage&.review? + add_resource("AWS::ElasticLoadBalancingV2::ListenerRule", "LBListenerRuleHTTP") do |j| + j.Actions [{"TargetGroupArn" => ref("LBTargetGroup1"), "Type" => "forward"}] + j.Conditions(listener.rule_conditions.map { |c| {"Field" => c["type"], "Values" => [c["value"]]} }) + j.ListenerArn listener.endpoint.http_listener_id + j.Priority listener.rule_priority + end end if listener.endpoint.https_listener_id.present?