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?

Thomas
已提问 7 个月前172 查看次数
2 回答
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
已回答 7 个月前
  • 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
专家
已回答 7 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则