Target groups not populated with targets automatically with ecs managed with AWS copilot

0

I created an ECS cluster with AWS copilot and it was working fine. At a particular time, I got a 503 service unavailable error and found out that target group to which the Load balancer is pointing doesnt have any registered targets. It happened abruptly and no targets were removed manually. But at the same time there are tasks running under the service and we can scale up the tasks. But the created tasks are not found registered under the target groups.

Later I manually registered the targets for the target groups.

Auto scaling is given for 0-4. But even when new tasks are added, the new tasks are not added to the target groups. Inly the manually added single task is available in the target group.

I tried redeploying the service. For some reason, deploying completed successfully without any new revision created.

Is there any way to reactivate the automatic registration of targets to the target groups

To put some context, this 503 happened while I was fiddling with the load balancer listeners and later found there are no active targets registered.

Requesting your kind advice and suggestions on this

1 Answer
0

Check the ECS service definition. It should have the target group configured on the service, which is what tells ECS to register/deregister tasks to the target group/ELB https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html

Is it possible when you were changing the listener, the target group got changed and there is a different one on the listener vs what's configured on ECS now?

AWS
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions