Use existing ALB for Load Balanced Web Services
Hello,
I'd like to deploy a Load Balanced Web Service using an existing ALB (that is already used for other ECS clusters). Is it possible ?
My application is deployed by a Jenkins pipeline using copilot and I don't want to delete the load balancer and reconfigured the old one every time.
Thank you
Related issues: #1457,
Hi @chris-adam-b12 !
Thank you for the feature request, it seems to be related to: https://github.com/aws/copilot-cli/issues/1457
To help us deliver the right thing, would the imported load balancer already have a port 80 or port 443 listener?
If there is already a port 443 listener I assume that you have your own managed certificates attached to it, is that correct?
Hi @efekarakus ,
Indeed, it is related.
Yes, my load balancer have both port 80 and 443 listeners. I also have a certificate attached.
We'd like to have this feature too.
The ALB could be imported when the environment is created (like VPC and subnets), and certificates handling should be disabled.
Same request. this feature would be really helpful. Since a single ALB can now be used to configure different services, I think it would also be important to have the different conditions for ALB routing rules, available as properties in the manifest. e.g host headers, HTTP headers, Query string, etc.
Agreed, this would be really helpful. ALBs are the most expensive part of Copilot's load balanced web services for me - with spot tasks the compute costs can be low, but if I have a bunch of small apps that all need dev/qa/prod environments, then I'm going to spend a LOT on ALBs. Like maybe 50-75% of the total costs. It's nice that related services can reuse the same ALB but that is not a preferred way to go about organizing apps which should actually be entirely separate.
+1. must have
I am looking for a quick and easy way to build many Feature Environments. Copilot seems to solve that, but I am disappointed that it will be costly if I cannot use my existing ALB...
+1 This feature would help in increasing cost efficiency for lower envs.
+1 Please add this feature.
Hi all, AWS Copilot v1.32.0 is now released: https://github.com/aws/copilot-cli/releases/tag/v1.32.0 🎉🚀 We shipped the feature that lets you place your existing ALB in front of your Load-Balanced Web Service - just specify the name or the ARN of the ALB in the http.alb field. Check out our blog post for more details, as well as other very cool features ❤️ !
Closing the issue because the importing feature is already released in v1.32.0. Feel free to reopen it though, if you have questions / requests unanswered ❤️
Hi team! I have the following manifest.yml to designate an existing public-facing ALB for a specific Load-Balanced Web Service.
# Your service name will be used in naming your resources
name: prov-recos-copilot-service
type: Load Balanced Web Service
# Distribute traffic to your service.
http:
# Requests to this path will be forwarded to your service.
path: '/'
# Parameters for existing AWS LoadBalancer resources that your service requires.
alb: '<load balacer arn>'
# Configuration for your containers and service.
image:
# Docker build arguments.
build: Dockerfile
# Port exposed through your container to route traffic to it.
port: 8080
cpu: 4096 # Number of CPU units for the task.
memory: 8192 # Amount of memory in MiB used by the task.
platform: linux/x86_64
count: 1 # Number of tasks that should be running in your service.
exec: true # Enable running commands in your container.
network:
connect: true # Enable Service Connect for intra-environment traffic between services.
But I'm getting back the following error when I copilot deploy: execute deployment 1 of 1 in group 1: deploy service prov-recos-copilot-service to environment demo: validate imported ALB configuration for "http": imported ALB <load balacer arn> must have either one or two listeners
So I guess my question is, how do I add these parameters to my .yaml? Please
Edit: moved my answer to #5473 !