Snake
Snake

Reputation: 14668

Connecting cloud run on GCP A to cloud sql on GCBP B using a proxy

So I have been trying this for some times and I can't figure it out. There are multiple ways as per the chatgpt instructions and not a consistent recommendation thus time for human brain here :)

So I am working with client who has cloud SQL instance and cloud sql Auth installed on their GCP (called it GCP B). In my GCP (GCP A), I have a cloud run application that needs to connect to the database (I assume through cloud auth).

I got the client to add my cloud run default cloud run GCP A service account [email protected] to his IAM roles with cloud sql client role. I did the same in my IAM and gave it admin and client role.

and I deployed my cloud run as follows:

gcloud run deploy <SERVICE_NAME>
--image <IMAGE_URL>
--add-cloudsql-instances <PROJECT_ID>::<INSTANCE_ID>
--region
--project <RUN_PROJECT_ID>

I keep getting connection error. Then I tried getting the cloud SQL service name from the client and I added it to my IAM and same issue.

What am I missing here? what are the true steps to make it work I

Upvotes: 0

Views: 32

Answers (0)

Related Questions