Copilot-cli: Support multiple ports

Created on 23 Dec 2020  路  8Comments  路  Source: aws/copilot-cli

Hello,
I love your project, and it's really made my life so much easier :)

I couldn't find a way to expose multiple ports from my web service, something similar to Kubernetes:
ports:
- containerPort: 50051
- containerPort: 3000

Thanks!

sizM typenhancement typrequest

All 8 comments

Hi @felix-zg !

Unfortunately, we don't have a way yet to expose more than one port for a container.
Can you tell me a little bit more about what's a usecase for opening up multiple ports? So that we make sure to build the right thing.

Are you deploying a "Load Balanced Web Service" where "/pathA" routes to port 50051 and "/pathB" routes to 3000? i.e. each port is associated with a path.

To mitigate the issue in the mean time, I wonder if it's possible to deploy two Load Balanced Web Services one that routes to 3000 and another one to 50051.

Hey @efekarakus,
Thank you for your quick response.

I can solve this issue using part routing to designate ports with Nginx for example.
I'm trying to operate YataiService, you can read about it here: https://docs.bentoml.org/en/latest/deployment/aws_lambda.html#deploy-and-manage-aws-lambda-deployments-with-remote-yataiservice

Hello,

I have a use case with an MQTT gateway container that runs in an ECS cluster today and that has been set up manually. It uses ports 8883 and 1883. We would like to set this up with infrastructure partially set up with copilot (will re-use an existing VPC) and get the image from an existing ECR registry. The pipeline should be set up with copilot as well.

Hey,
How does one should expose both 80 and 443 from a container running nginx?

Hello @guyschlider right now we don't support exposing multiple ports either for app container or the sidecars. Could you provide more details about the use case when you are trying to expose both 80 and 443 from nginx?

Honestly, I guess the right thing is to expose 80 and take care of HTTPS behind ALB, but is that the case while using copilot?

When you provide a domain to copilot, we'll provision an ACM cert, assign it to your loadbalancer, and terminate TLS at the load balancer level. That way your service doesn't have to do any TLS termination.

I had to do it manually, but good to know that's an option (when DNS is being managed @ Route53)

Great tool!

Was this page helpful?
0 / 5 - 0 ratings