christippett / terraform-google-cloud-sql-pgbouncer

Automatically configure and deploy PgBouncer on Google Cloud with this Terraform module
MIT License
42 stars 23 forks source link

Step by step guide to deploy on Google Cloud with Cloud SQL #2

Open pip8786 opened 1 year ago

pip8786 commented 1 year ago

Is your feature request related to a problem? Please describe.

I haven't worked with terraform before. However, I'd like to set up PGBouncer in front of my Google Cloud SQL database since it's used by many different Cloud Functions and a Vercel/NextJS web app (which is also a serverless solution). I've been running out of connections on my database recently and started looking for solutions and this seems to be the recommended one. Note that I'm using Prisma to connect to the database, but I don't think that affects this request.

Describe the solution you'd like

I think a step by step guide on how to set this up on Google Cloud infrastructure would be really helpful in getting someone like me going.

Describe alternatives you've considered

Alternatively, I could try to infer how to set it up from the existing documentation and finding information on how to use terraform with Google.

andreyluchianic commented 1 year ago

@pip8786 almost same infrastructure in my case Next, Vercel, Cloud Run but i know terraform so if @christippett can help me setup it i can write step by step docs

pip8786 commented 1 year ago

@andreyluchianic That sounds great. I'd think all you'd have to do is fork this repository and add a *.md file in a pull request. I guess the other issue is this repository is pretty old now and I had to make a lot of updates to it to get it to even run: https://github.com/social-cascade/terraform-google-cloud-sql-pgbouncer. I'm not sure that it's maintained anymore so starting a fresh fork and just working on that may be best?

andreyluchianic commented 1 year ago

actually @pip8786 i got this working with example default configuration, the only problem was #7 and i was able to connect to my database trough pgbouncer

not used admin account tho db is old - PostgreSQL 11.16

andreyluchianic commented 1 year ago

i have 10 databases for each CMS,
looks promising

Screenshot 2023-02-20 at 17 18 54