1

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 ?

Luxior
  • 133
  • 1
  • 13

1 Answers1

1

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.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • Okay, so if for exemple i create a CodeDeploy with an API, and two target groups. During deployment, there will be one task for my currently in production API, and one other task for the "next to be" production ? So there will be by default two tasks on the same instance, listening on the same port ? Is this why there is a "production" port, and a "test" port that can be configured ? – Luxior Feb 08 '21 at 01:58
  • @Luxior Give me a monent. I have to check how I have it setup :-) – Marcin Feb 08 '21 at 02:00
  • @Luxior My tasks use `awsvpc` network mode, so two task can be on same port on same instance as each task will have its own ENI. I think for different modes, you would need to use different ports. – Marcin Feb 08 '21 at 02:07
  • Hm i see, i will try it in the day, but since i use in the same task defintion a reverse proxy and an API, i don't really know how i will do it. I'll try anyway – Luxior Feb 08 '21 at 11:31
  • @Luxior Yes, good chance to try. If you encounter difficulties please feel free to ask. – Marcin Feb 08 '21 at 11:33