millenion
millenion

Reputation: 1877

Cloud Sql Proxy Private IP External application

Simple question: Is there any way to connect to a GCP SQL Database under private IP through cloud sql proxy from an external application ? (local development environment)

I followed every step in the official tutorial to configure cloud sql proxy with all requirements, but all connections fail in a sort of timeout.

Upvotes: 0

Views: 3509

Answers (2)

kurtisvg
kurtisvg

Reputation: 3565

The Cloud SQL proxy will work with a private IP address as long as it can reach the private IP address.

See the "Connecting from an external source" section on the Configuring Private IP page for a list of steps to set up a VPN that can provide access to your VPC.

Upvotes: 0

Daniel Ocando
Daniel Ocando

Reputation: 3764

In order to connect to a Cloud SQL instance using only private IP through the Cloud SQL proxy will be to install the proxy within a resource (could be for example a Compute Engine instance) with access to the same VPC network as the Cloud SQL instance. Since your local development environment might not comply to that requirement the connection will fail.

You could move your local development environment to a compute engine instance located within the same VPC network as your Cloud SQL instance or temporarily enable Public IP on the instance and authorize only your IP through the authorized network options and use the Cloud SQL proxy to gain access to the instance.

Upvotes: 1

Related Questions