I have a UAT ECS cluster with two EC2 instances. I have one of the services (inside the same cluster) which has Desired Task = 1 (so it runs on any one of the two EC2 instances). I have a ELB and targetgroup having the healthy instance.
Problem : Whenever a deployment happens, the running task is stopped and the new task is started in the other EC2 instance. This does not update the target group accordingly. So every time after the deployment, the target group holds the previous unhealthy EC2 target, where the task was running before the deployment.
Is this an expected behavior from AWS ? Any suggestion how I can bypass the manual action I take every time after deployment?