I have a setup with a Cloud SQL MySql server that is connected to a shared VPC. The Sql server has no public IP. In the same project I have a serverless VPC access configured that connects to the same Shared VPC.
I created a Cloud SQL connector using a service account that has the Sql Editor role. The connector fails to initialize. The error message given is “The connection has been closed.”.
When I enable a public IP on my Sql Instance (without any other modification) the connector becomes active.
Is the use of private IPs through shared VPC a supported feature of this connector?
Connecting to CloudSQL through private IPs are supported. For this you will have to setup a sock5 proxy and expose that through a service attachment, like here:
Currently this is the only feasible solution and we are working on enhancements in roadmap to avoid Socks5 proxy. Documentation below would help for PSC configuration.
We are yet to publish CloudSQL specific documentation.But additional step would be to setup Socks5 proxy and expose it as service attachment which can be used while creating connection
@NaveenV1 It is a communication between two different gcp projects, the cloud run is in project A and the cloud sql is in project B. What it tells me does not cover what I indicate