Create ECS service using existing load balancer with existing target group
I'm using the AWS console to create an ECS service (using fargate) in an existing cluster.
In the second step of the wizard (configure network) I choose an existing application load balancer.
The "container to load-balance" section shows my container to add.
When I click "add to load balancer" it initially shows the "production listener port" and "target group name" dropdowns showing "create new".
When I select an existing target group in the dropdown this grays out (disables) the "production listener port" dropdown.
When clicking the "next step" button validation complains the "production listener port" is not filled in (validation message: "please select a listener"). Which isn't possible because the control is disabled.
First selecting a listener port in the wizard and switching to an existing target group after that doesn't remedy the situation as choosing an existing target group blanks out and disables the "production listener port" dropdown causing the same problem when clicking the "next step" button.
How to get the container to register in an existing target group?
The target group is an empty IP address group.
Interestingly it does work if the target group is not empty (the "production listener port" is then filled with 443:HTTPS) but an empty target group (even of the correct type) clears the "production listener port".
1. Create a new target group of type "IP address" leaving other default settings. Do not register any targets in this group.
2. Next add this target group to a (new or existing) load balancer (for testing I added the group to an existing load balancer with a single source IP address filter e.g. 192.168.1.1/32 so it doesn't disrupt normal operations).
3. When creating a new ECS service select a task definition that has a container with an exposed port 80.
4. On the second screen "Configure Network" choose the VPC and subnets and under "Load balancing" pick "Application load balancer".
5. Select the load balancer to which you added the empty target group.
6. Now click "Add to load balancer" next to the container. This shows the "Production listener port" and "Target group name" dropdowns both initially set to "Create new".
7. Choosing the empty target group disables the "Production listener port" dropdown and clears it.
8. If the target group is not empty the "Production listener port" is automatically filled with the correct port.
What kind of target group configuration do you have? The target group needs to be "IP address" -- a target group that is configured to route to instance IDs will not work.
Same problem here, this is really annoying
Create ECS service using existing load balancer with existing target groupasked 4 months ago
Duplicate an existing serverless app infra(built in the console management) using terraformerasked 2 months ago
Using cloudformation for setting upp global database and second cluster from existing clusterasked 3 months ago
How to add EC2 to existing ECS cluster?Accepted Answerasked a month ago
Is it possible to assign an existing Network Load Balancer to an AWS EKS resource via annotations?Accepted Answerasked 2 years ago
How many Load Balancers of what schemes are actually required while creating an ECS cluster with AutoScaling Via Capacity Provider?asked 4 months ago
how to create multiple ingress port on Amazon EKS using single Application Load Balancerasked 2 months ago
How to configure subnets for an ECS cluster so it can access a database in the same VPC?asked 2 months ago
Cannot create ECS service with existing load balancerasked 3 years ago
ECS fails to remove a task from the load balancer target group?asked a month ago