-
Notifications
You must be signed in to change notification settings - Fork 254
Docker-ECS load balancer, HTTPS and routing #1472
Comments
Hi.
This is indeed the main issue to address this: we don't want to provide yet another set of AWS-specific extensions that won't ever be adopted in the compose-spec. But on the other hand, compose model doesn't cover the "routing" aspect, so this need to be defined in a portable way. We also need to offer a transparent support for local development, maybe using a simplistic approach like we do for secrets by just bind mounting plain text files: we could use a "routing container" dynamically added the the compose application. A viable solution will require
In the meantime, there's no simple option with ECS integration but to tweak the CloudFormation template to "fill the gap" |
@ndeloof Thanks for getting back. We are happy to adopt any alternatives. Can you elaborate on your viable solution, specifically "a high-level, declarative approach" and "map to AWS"? Since we can't do path routing, we are considering the following approaches: Frontend and API in the same compose
Frontend and API in different stacks
Would something like these work? How would setting HTTPS up look like in any of those? |
I'm only thinking "middle/long terms". There's no silver-bullet solution to this yet, but to create your own Load balancer and tweak the generated CloudFormation template for your needs. |
Understood. Could you suggest a short term solution that fits in our need? We are okay to compromise but hope to get specific and actionable guideline. Would any of the two approaches in the previous comment work? If our needs aren't clear, we can always clarify. Assuming we can follow some AWS doc to create a load balancer and Thanks again! |
@ndeloof Any feedback? Today we try to setup HTTPS for load balancer using the example in doc
The certificate is a valid one from ACM. We point our domain DNS CNAME to the DNS name of load balancer created by compose |
double check you access your service on port 80, which is not the default one for https: |
While this is encouraging, how do we access this domain on HTTPS without |
we don't yet have an option to expose a distinct port for ingress traffic. You can tweak the cloudformation template so it set Listener external port to 443, or can change your compose file so that port 443 is used for service's HTTP traffic |
Another option which I have used is adding a nginx container, which is the only container with published ports, 80 and 443. Then I use nginx for all internal routing. You can put your cert and private key in secrets and configure your nginx container to use those files mounted at |
Edit: Sorry, this was user error on my part. |
@chingc replacing Webapp with the name of your service in Pascal case seems to fix the problem for me. Another the thing is the guide (https://docs.docker.com/cloud/ecs-integration/#setting-ssl-termination-by-load-balancer) does not cover the part where 443 port is not opened in security group. for my case: x-aws-cloudformation:
Resources:
BackendTCP80Listener:
Properties:
Certificates:
- CertificateArn: "arn:aws:acm:xxxxxxx"
Protocol: HTTPS
Port: 443
Default80Ingress:
Properties:
FromPort: 443
ToPort: 443 |
Even with these extra lines isn't works :/ |
Or, just use ECS Compose-X ? Here is a walkthrough of ELBv2 (ALB) that uses cognito userpool and Azure for auth This does not just take care of creating CFN templates. It will actively check that
Hope this helps, and if any, feedback most welcome Edit: I missed that band wagon of the x-aws-cloudformation thing, but I think that ecs-compose-x is much closer to what the Not to mention, all the other |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
Greetings! This issue has been discussed a lot elsewhere. After reading all the docs and other related issues, we still aren’t sure how to do it. We are hoping to get concrete guidance for setting up our stack which can be conceptualized in the following way
How do we set up the compose so that:
While this can be easily achieved using Traefik but we struggle with Docker-ECS. So far we understand:
example.com
and API requests toapi.example.com
We are particularly confused because the official doc is limited but community resource with examples contain conflictive information.
For example, the doc says
Looks simple but then the community suggests otherwise.
https://techsparx.com/software-development/docker/docker-ecs/load-balancer/https.html
Slack groups also confirms there no way to avoid going through this.
We understand this project is still in development with its limitation so we are flexible in terms of technical solutions as long as business requirements are satisfied. Any feedback is appreciated.
The text was updated successfully, but these errors were encountered: