-
Notifications
You must be signed in to change notification settings - Fork 253
I can't specify on which subnet I would like service to run #2161
Comments
Hi Komatom, I am looking to do the same. Were you able to resolve your issue? |
Hello both, Hoping this will be helpful for you to keep docker-compose compatibility with more features that currently supported by this plugin. You can do that with ECS Compose-X: using x-vpc via creating a new one or via Lookup for an existing VPC and its subnets, you can then define networks, the docker-compose way with As for DB/ELB and such, these resources will have a Here are some examples that might be helpful: https://docs.compose-x.io/how_tos.html Any requests/feedback, let me know! |
hi John,
In another question thread, they suggested that I look at the compose convert document (aws cloudformation for me) to see how to add x-aws-cloudformation informatin into the yml file. Add the overlay to the end of the docker-compose file, add the subnets you'd like to use to the script for each of the services:
|
Hey. Sorry for "delay" in reply. Here is what you are trying to do would look like using ECS Compose-X instead of this ECS plugin... version: '3.8'
# Define networks and map these to x-vpc Subnets, to use with the services
networks:
application:
x-vpc: AppSubnets
storage:
x-vpc: StorageSubnets
services:
osticket:
container_name: osticket-web
image: osticket/osticket
environment:
MYSQL_HOST: db
MYSQL_PASSWORD: secret
depends_on:
- db
ports:
- 80:80
networks:
- application
db:
container_name: osticket-db
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: osticket
MYSQL_USER: osticket
MYSQL_PASSWORD: secret
networks:
- storage
# Just as an example, if you wanted to use RDS instead.
x-rds:
my-db:
MacroParameters:
Engine: mariadb # Did not check the name
EngineVersion: 10.4 # Did not check the engine version!
Services:
osticket:
Access:
DBCluster: RO # Allows rds:Describe on Cluster and Instances
SecretsMappings: # Compose-X will generate a new Random username/password for the DB
Mappings: # Map the key in the secret to the environment variable name your app needs
host: MYSQL_HOST
port: MYSQL_PORT
username: MYSQL_USER
password: MYSQL_PASSWORD
dbname: MYSQL_DATABASE
x-vpc:
Lookup:
VpcId:
Tags:
- Name: my-existing-vpc
PublicSubnets:
Tags:
- Name: my-public-subnets
AppSubnets:
Tags:
- Name: my-application-subnets
StorageSubnets:
Tags:
- Name: my-db-storage-subnets
Does that help? |
Thank you so much, I will try out your config without the RDS for the moment. Will report back. |
hi John, Does the below configuration look right?
Thank you again!!! |
Hey. yes, you are correct, you need python3 and install it with that. you can run it as a container too, you just then need to mount your was creds folder accordingly for API calls to succeed. See https://gallery.ecr.aws/compose-x/compose-x I used to have You don't need a lot of tags on your resources to use the If you don't care about re-using the VPC you already have, you can just omit |
hi John, Install in a virtual environment # Recommendedpython3 -m venv venv So, will the code below work now for what I am trying to do?
Thank you so much!!!! |
hi John, Installed ecs-compoose-x and when I typed: ecs-compose-x --help, I immediately get the following error:
Can you help with this please and also I thought that I could just do docker compose up but looking at the install guide, it seems I have to run something close to the below command?
Thank you |
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. |
Hi
in other words I am trying to run databases in 1 subnet, web serice in another subnet. I kind of can do this over "x-aws-cloudformation:"
but I am having trouble with NFS access points, because they are created for all subnets per service, but I limit the service to 1 subnet and CloudFormation template roll backs and can't update.
So is there an option to specify for each service section to tie it to a subnet, and respectively from that list to be generated the NFSMount targets.
Thanks
The text was updated successfully, but these errors were encountered: