New ECS service - not able to create a target for a 2nd listener

0

We have created a cluster in ECS and now we want to create a service in this cluster. During the creation process it's only possible to define 1 listener. We point this listener to a target group en the target group automatically picks a target. (that target is neatly assigned a dynamic port mapping)

According to the documentation it's possible to manually create a 2nd listener via the EC2 console (within the Load Balancer section). When we do that the target group is created, but in that target group the target isn't automatically created. And a port is not dynamically mapped.

We need to do this manually, but that's not what we want. We also want a target to be automatically added to the target group for the 2nd listener with the correct dynamic port (docker proxy port). Just like the 1st listener. Is that possible?

Screeshot creating service

  • Can you confirm why you need a 2nd listner?

2 Answers
0

Our problem is that the application running on the EC2 instance needs to use port 80 and 443. This needs to be a 1-on-1 connection with the ELB. We tried a redirect on the ELB, but that doesn't work. We don't see an option in the console (when creating the service) to add a 2nd target group. Do you know if this option exists? Ports

Thomas
answered 6 months ago
  • Yes as per my answer. This is possible but not via the GUI. You have to do it via CLI or a deployment. Please see URL in answer.

0

Im not sure why you need a 2nd target? however yes, this is possible.

You can register the ECS Service to a 2nd Target group so you do not manually have to add or remove targets. You can’t do this via the GUI however.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html

profile picture
EXPERT
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