Skip to content

Commit

Permalink
Merge pull request #796 from degica/ordered-ecs-service-build
Browse files Browse the repository at this point in the history
Fix ECSService sometimes failing to create
  • Loading branch information
davidsiaw authored Sep 7, 2023
2 parents e229b1b + 9d2d730 commit e630f08
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/models/backend/ecs/v2/service_stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ module Backend::Ecs::V2
class ServiceStack < CloudFormation::Stack
class Builder < CloudFormation::Builder
def build_resources
add_resource("AWS::ECS::Service", "ECSService") do |j|
j.Cluster district.name
deps = []
if use_alb?
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
j.TaskDefinition options[:task_definition]
j.DesiredCount options[:desired_count]
if use_tcp_load_balancer?
Expand Down

0 comments on commit e630f08

Please sign in to comment.