I have a Cloud Run running in one VPC project, and I need it to be able to connect to a Cloud SQL database in another GCP project, but I don't know how to achieve this.
Hi Norteña,
Cloud Run is in project A and Cloud SQL is in project B.
Create a service account in project A.
Add the service account from project A to the Cloud SQL instance's IAM policy in project B.
Setup the connection by following https://cloud.google.com/sql/docs/mysql/connect-run#private-ip
I hope it helps,
Julien
Hi,
If by chance the suggestion of Mr. @julien_bisconti did not work, my other advice would be to configure the VPC peering[1]. This allows private communication between the resources in different projects.
Then I also agree with the IAM Permission suggest by Mr. @julien_bisconti through service account.