When you are attaching LoadBalancer to existing ECS::Service via Stack Update, despite having AWS::ElasticLoadBalancingV2::ListenerRule as DependsOn attribute, Stack Update will fail with The target group with targetGroupArn <ARN> does not have an associated load balancer.
Expected Behavior
I would expect, that Update and Create behaves the same, and Update does not introduce race condition.
Observed Behavior
Instead ECS::Service fails with The target group with targetGroupArn <ARN> does not have an associated load balancer.
Test Cases
Have a CloudFormation template which implements two ECS::Service's, one with LoadBalancers set on Create, other without. Make a following Update stack call, with extending second ECS::Service with LoadBalancers and it will fail even with ListenerRule listed on DependsOn.
My bad on rushing to report bug, this has been identified as !Ref issue locally in template in rather complex Cloudformation stack with many Services & TargerGroups.
Name of the resource
AWS::ECS::Service
Resource Name
No response
Issue Description
When you are attaching LoadBalancer to existing ECS::Service via Stack Update, despite having AWS::ElasticLoadBalancingV2::ListenerRule as DependsOn attribute, Stack Update will fail with
The target group with targetGroupArn <ARN> does not have an associated load balancer.
Expected Behavior
I would expect, that Update and Create behaves the same, and Update does not introduce race condition.
Observed Behavior
Instead ECS::Service fails with
The target group with targetGroupArn <ARN> does not have an associated load balancer.
Test Cases
Have a CloudFormation template which implements two ECS::Service's, one with
LoadBalancers
set on Create, other without. Make a following Update stack call, with extending second ECS::Service withLoadBalancers
and it will fail even with ListenerRule listed on DependsOn.Other Details
No response