I'm having trouble while trying to apply a modification on a ECS cluster. Particularities of the environment:
- Cluster has 2 services: blue and green.
- Currently both services are associated to an Application Load Balancer that is exposed to the Internet.
What I want to do: add another ALB, in this case an internal one, to receive requests from private subnets in the VPC for the same service (same container, same port). When trying to apply those modifications I'm getting the following error:
CloudFormation cannot update a stack when a custom-named resource requires replacing. Rename [ClusterName|ServiceName] and update the stack again.
I'm describing these new entities using yml files. It's worth to mention that the new load balancer, its listeners and target groups were created successfully (even though the target group is not detecting the EC2 instances). The problem occurs when adding the LB to the the ECS service. Is this normal? Is it possible to have 2 LBs for the same ECS service for same port and same container name? Is there a workaround for doing this without renaming the cluster?
Edit: I tried creating a new ECS service with 2 load balancers associated to it and I got the following error (which is much more specific):
load balancers can have at most 1 items
So no, ECS services can't be associated to more than one ALB. The remaining question is: is there a workaround for this other than creating new ECS services for private subnet use?
Thanks.