Search code examples
amazon-web-servicesamazon-ecsaws-code-deployaws-application-load-balanceraws-auto-scaling

How to use CodeDeploy with ECS, ALB and Auto Scaling


I'm trying to use CodeDeploy and ECS with an Application Load Balancer, and Auto Scaling with a strategy on the number of request of this ALB.

I'm using this URL as some sort of tutorial, but i don't really understand how CodeDeploy will integrate with ECS and other stuffs.

First, as i can see, i need two target groups on my ALB. But i only have one (that is, instance(s) that are / will be created by Auto Scaling)

So what do i need to do ? Does creating an empty target group, and telling CodeDeploy to use both work ?

What will it do, deploy instances in this target group and redirect a part of or the whole trafic to it once working ? As stated in the same link

"During deployment, CodeDeploy installs your update into a new, replacement task set."

So it seems to create new tasks, but on what instance then ?


Solution

  • So what do i need to do ? Does creating an empty target group, and telling CodeDeploy to use both work ?

    It can't be empty. Your new TG can be same as your first one. So at this stage you will have to TGs which are same (except thier name).

    The second TG is specified when you create your ECS deployment group in CodeDeploy.

    What will it do, deploy instances in this target group and redirect a part of or the whole traffic to it once working ? As stated in the same link

    These will be same instances as the one running your current ecs task.

    So it seems to create new tasks, but on what instance then ?

    These will be same instances as those that run your current task.