Piyush Chitkara
Piyush Chitkara

Reputation: 305

How do I whitelist private IP in Google Cloud SQL?

I am trying to create an Autoscaling web application network over HTTP Load Balancing. The Web Server Instances are going to be connected to load balancer. Further the web instances have to be connected to mysql/cloud sql through the internal IP.

So just to conclude, I need to use the Linux Web Instance (Not App Engine) and Connect to MySql/Cloud SQL through Internal Network Only? Is it possible?

Thanks!

Upvotes: 5

Views: 14231

Answers (3)

Matej
Matej

Reputation: 9805

You should use the cloud SQL proxy.

It runs on the box providing secure access to your Cloud SQL database.

Example here for container engine: https://cloud.google.com/sql/docs/container-engine-connect

Upvotes: 5

Adrián
Adrián

Reputation: 2880

It's not possible, you need to use an external IP as stated in the documentation:

Note: You must use the external (public) IP address of the GCE instance.

Also, you can find here that it's not possible to authorize a private network like the one specified:

You can not specify a private network (for example, 10.x.x.x) as an authorized network.

Upvotes: 6

Ryan
Ryan

Reputation: 2542

To access the CloudSQL the IP must be white listed. To white list an IP go to your project then on the side bar: Storage -> Cloud SQL. Select your instance then 'Access Control'. Under 'Authorization' click the '+' to add your IP.

Upvotes: -3

Related Questions