- Newest
- Most votes
- Most comments
Hello,
Registering Two ECS Services to the Same Target Group
It is possible to register two ECS services to the same target group to test two versions of your application simultaneously.
1.Select Target Group:
- Navigate to the EC2 dashboard.
- Select “Target Groups” under “Load Balancing” in the navigation pane.
- Create a new target group or note the ARN of the existing one you want to use.
Create/select ECS Services:
- Go to the ECS dashboard.
- Select “Clusters” and choose your cluster.
- Click “Create” under “Services”.
For each version of your app:
-
Choose the same cluster.
-
Select launch type (EC2 or Fargate).
-
Configure your service name and number of tasks.
-
Under “Load balancing”, select “Application Load Balancer”.
-
Choose the listener and select the target group you created or selected earlier.
-
Repeat for both versions.
Adjust Task Counts:
- Go to the “Services” tab in your ECS cluster.
- Select the service for the old version and click “Update”.
- Adjust the “Desired tasks” to decrease the count.
- Select the service for the new version and click “Update”.
- Adjust the “Desired tasks” to increase the count.
Referral Documentation: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html
Hi,
ECS / Fargate has features to do what you want called Blue/Green deployment.
See :
- https://medium.com/@rplearn06/blue-green-deployments-on-ecs-fargate-79fa7a78a9ba
- https://medium.com/@jaclynejimenez/what-i-learned-using-aws-ecs-fargate-blue-green-deployment-with-codedeploy-65dde6781fcc
The official documentation is here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-blue-green.html
Best,
Didier
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated a year ago

Hello, Thanks for the response, but I mentioned code deploy in my question, we cannot use it currently.