ECS を Cloud Formation で作成してたら The target group does not have an associated load balancer が発生した

参考

解決方法

ECS のサービスの定義に「DependsOn: リスナー」を追加する。

########################################################
### ECS Service
########################################################
HogeEcsServiceA:
  Type: "AWS::ECS::Service"
  DependsOn: HogeALBListener
  Properties: ...

理由

The Amazon ECS service requires an explicit dependency on the Application Load Balancer listener rule and the Application Load Balancer listener. This prevents the service from starting before the listener is ready.

Amazon ECS サービスでは、ApplicationLoadBalancer リスナールールと ApplicationLoadBalancer リスナーに明示的に依存する必要があります。これにより、リスナーの準備が整う前にサービスが開始されなくなります。

...との事。

YouTube