How to give one GCP project access to another GCP project's SQL database?

495 views
Skip to first unread message

Jenny Pilchard

unread,
May 8, 2020, 12:41:26 PM5/8/20
to Google Cloud SQL discuss
I am getting this error. 


CloudSQL warning: your action is needed to update your function and avoid potential disruptions. Please see https://cloud.google.com/functions/docs/sql#troubleshooting for additional details: ensure that the account has access to "xyzapp:us-central1:db-11-dev" (and make sure there's no typo in that name). Error during createEphemeral for xyzapp:us-central1:db-11-dev: googleapi: Error 403: The client is not authorized to make this request., notAuthorized

ProjectA: We run the App on this

Project B: All the database instances and databases are setup here

Project A needs to have access to Project B's databases.

I have enabled Cloud SQL Admin API for project A. But I don't know how to grant access to CLOUD SQL Admin API from project B Database.

Katayoon (Cloud Platform Support)

unread,
May 11, 2020, 9:44:14 AM5/11/20
to Google Cloud SQL discuss
Hi Jenny,

It seems you are trying to connect to your Cloud SQL instance resides in Project B from the Cloud Function resides in Project A. If so, you should make sure that your cloud Function'd service account used has the correct permissions along with enablaing the Cloud SQL Admin API. You may take a look at these configuration steps to better undrestand what IAM roles and prmissions are required for connecting to the instance. 

Reply all
Reply to author
Forward
0 new messages