-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS::ECS::Service needs DependsOn AWS::ElasticLoadBalancingV2::ListenerRule #1160
Comments
Edit: ah no, you're right. |
When ALB listener rules are used, the ordering dependency for services that require an attachment to a Load Balancer has to be on the `AWS::ElasticLoadBalancingV2::ListenerRule` object, not on the `Listener` object (as the current implementation does). Fixes #1160.
When ALB listener rules are used, the ordering dependency for services that require an attachment to a Load Balancer has to be on the `AWS::ElasticLoadBalancingV2::ListenerRule` object, not on the `Listener` object (as the current implementation does). Fixes #1160. BREAKING CHANGE: `targetGroup.listenerDependency()` has been renamed to `targetGroup.loadBalancerDependency()`.
Not sure if it will be seen here, but I don't understand why the service would have to depend on any of the other declared resources (load balancer, listener, target group). Surely the service can exist independently of any of these other resources, and rather should be a dependency of the other resources? I'm bringing this up because I want to conditionally create a load balancer and target group containing a service that will always exist, but CloudFormation cannot construct the service when the load balancer isn't created because the service depends on the load balancer listener. When I don't add the load balancer and target group ever (i.e. don't declare them at all), the service can be created just fine. |
When creating a service and adding it to a load balancer the CloudFormation template fails to deploy with the above error. Example code:
This is probably happening because the
AWS::ECS::Service
resource needs aDependsOn
to theAWS::ElasticLoadBalancingV2::ListenerRule
resource. Otherwise it is a race condition that causes a failure if the service resource creation starts before the listener rule is ready.The text was updated successfully, but these errors were encountered: