prisma / prisma-templates

Prisma templates for major cloud providers
MIT License
52 stars 41 forks source link

Two VPCs for one app seems overkill #9

Open neekolas opened 6 years ago

neekolas commented 6 years ago

Between this Fargate config and the MySQL template, hosting your own Prisma instance on AWS requires you to create two new VPCs. That seems unnecessary, especially since Amazon caps your account at 5 VPCs total per region by default.

The easiest thing would be to add some conditions in to both templates and let you specify an existing VPC and subnet. The better solution IMO is to merge the two templates and put everything into one VPC. It would also cut down on a bunch of copy and paste between the two configs.

I'm happy to handle rejigging the templates and testing it out. Just want to make sure there wasn't a rationale behind the setup.

mcmar commented 5 years ago

I think the only rationale is that they're currently 2 separate templates. I would personally love it if you could rejigger the templates to use the same VPC because I've already hit my cap of 5 VPCs in the US-West-2 region.

flowirtz commented 5 years ago

I agree, two VPCs really don't seem reasonable - even though you can increase the limit of 5 via a support ticket.

Putting everything into one VPC should be easily doable. You could still completely isolate the DB from Fargate if you place them into different private subnets, though I don't think that's necessary anyways.

jordan-erisman commented 5 years ago

Anyone had any luck doing this? I am struggling to get my single file to work properly.

flowirtz commented 5 years ago

@erisman20 yeah I have both running in the same VPC. I have a terraform file I could clean and share with you, in case you're interested.

tonyfromundefined commented 5 years ago

@erisman20 I created CloudFormation templates with 1 VPC. Check my repository.

https://github.com/tonyfromundefined/prisma-aws-cloudformation