Chabane Refes
Chabane Refes

Reputation: 11

The peering connection cloudsql-mysql-googleapis-com is not established when a Cloud SQL instance is configured to use Private IP

I have created a private Cloud SQL instance in an app project. The network used is a shared VPC and it is hosted in a network project.

In the shared VPC:

If I go to the VPC Network > VPC Network Peering page, I don't see a peering connection named cloudsql-mysql-googleapis-com. Therefore, I cannot connect to my cloud SQL instance using its private IP address. I can only reach the cloud SQL instance using its public IP address.

The same infrastructure works for the development environment, I use terraform to generate the GCP resources. The two environments have exactly the same configuration.

Source code: https://gitlab.com/Chabane87/cloudsql-issue

Does anyone know when this problem can happen?

Thanks

Upvotes: 1

Views: 673

Answers (1)

Anbu Thirugnana Sekar
Anbu Thirugnana Sekar

Reputation: 113

Based on the discussion about this issue on our another support channel, it seems connectivity tests were run to zero in on the problem. While the connection from one of your instances to Cloud SQL succeeded using public IP, it failed when using private IP but that is the intended behaviour.

The Telnet test was conducted later using live traffic from the instance to Cloud SQL and found that a port is missing in the production environment while it is defined correctly in the development environment and hence it is confirmed there is no issue with the Networking. So, please try to connect to the Cloud SQL after adding the missing port to the prod project.

Upvotes: 0

Related Questions