Share Cloud SQL DB between 2 projects with app engine

48 views
Skip to first unread message

--

unread,
May 30, 2022, 12:39:19 PM5/30/22
to Google Cloud SQL discuss
Hi, 
I have a postgres Cloud SQL DB instance in my project A, it works perfectly with my django project on App Engine of project A. 

Now I have developed a project B and I would like to share the DB instance with project B. 
I put the same host as project A in the settings file of project B like:

/cloudsql/project-285409:europe-west4:project-A-DB

but when I deploy project B on app engine, django keeps having connection error 

could not connect to server: Connection refused   
Is the server running locally and accepting connections on Unix domain socket "/cloudsql/project-285409:europe-west4:project-A-DB.s.PGSQL.5432"?

I have enabled Cloud SQL API

Did I miss some settings or it is not possible to share DB between 2 projects?

Thank you







--

unread,
May 31, 2022, 8:55:35 AM5/31/22
to Google Cloud SQL discuss
Ok
 solution found. 

Just need to add service account of ProjectB to IAM of ProjectA

Reply all
Reply to author
Forward
0 new messages