-
Notifications
You must be signed in to change notification settings - Fork 252
Docker compose cli support for ECS with VPCs without public subnets #2125
Comments
I have a working set up with all Fargate instances running within private subnets and then a loadbalancer placed on public subnets. Have you tried defining the subnets for the loadbalancer? For more context see this issue. I would try just referncing only the private subnets in the
|
Although the reference issue address this problem, it only solves it for the load balancer side of things. So for example, if your compose contains volumes, the generated template will create EFS mount targets for all subnets in that VPC even though you have manually assign the subnets you want the services to support. |
@thehapyone, interestingly enough, I ran into this same issue just a few days ago. Have you found a way or to only create EFS mounts within the private subnets? |
@DustinHolden After many hours of frustration, I ended up having a separate cloud formation template for creating and managing the EFS volumes and all the required mount targets in their respective subnets. Afterwards, the created volume is used in the docker-compose file has an external volume so no new mount targets will then be created. |
Hi all. @fdoa , You can do all of that very simply with ECS Compose-X For load-balancers, databases etc, there is a similar setting, cleverly called Subnets I haven't had the use-case yet to change the subnets for EFS, but for EFS volumes @thehapyone , it'd work the same way using x-efs which allows to use that setting. Note that with x-vpc, the Hope this helps :) |
Thanks @JohnPreston , I will look into ECS Compose-X, it looks interesting. |
Cool. I had the same kind of constraints and decided that, users should just be allowed to define which subnets of their VPC to qualify in which ever way they want, and place services in there just as much in anyway they want. Hit me up if you have any questions. |
hi Guys, Am I using the x-aws-cloudformation correctly in my docker compose file below?
Thank you Because when I run docker compose up, it still complains:
|
Any updates on this? I'm getting the same behavior with a simple docker compose up. Both with and without setting the x-aws-vpc: |
hi jakcst, Please look into https://docs.compose-x.io/index.html and if you have questions, try to png John Preston, he has been a great resource. |
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. |
Description
The current implementation relies on VPCs with public subnets, and if there are no public subnets it throws an error straight away.
I'm working in a use case where the VPC where I want to deploy the stack has only private subnets. I'm using Transit Gateway, and Egress traffic to the internet is done via an egress VPC.
I would like to be able to use Docker compose for this scenario.
A simple solution could be to add the following parameter:
Then based on the discovery of the subnet if it's public or private, it could then determine automatically the LoadBalancer scheme (internal / internet-facing).
The text was updated successfully, but these errors were encountered: