Jose Gleeson
Jose Gleeson

Reputation: 323

Do I need a Provate VPC to Allow Cloud SQL Access from another GCP project?

I currently have the following structure

Project 1
Cloud SQL Instance

Project 2
Cloud Run Instance
Service account

I would like the project 2 cloud run instance to access the Project 1 Cloud SQL instance.

To do this I...

  1. Add the project 2 service account to project 1 and give it permissions.
  2. Go into CloudSQL and setup the user and connect to the DB to setup permissions and roles.
  3. Try to access CloudSQL instance on the Cloud Run instance using SQL Auth Proxy

But I see posts like this that suggest I should be using a VPC...

Accessing Cloud SQL from another GCP project

But I would really like to avoid managing 2 vpcs for this. Is there a way to do it without VPCs? And based on the post the best option is to pair 2 VPCs?

Upvotes: 0

Views: 322

Answers (1)

Yvan G.
Yvan G.

Reputation: 1298

Posting this answer for the awareness of other users on what we have discussed in this question. In this scenario we have discussed that firewall rule from this concern is needed to have access from the public server.

I would also like to share this link on how you can enable public ip address in cloud sql.

Upvotes: 1

Related Questions