Search code examples
postgresqlgoogle-cloud-platformgoogle-cloud-sqlgoogle-cloud-networking

Can't access Google Cloud SQL with private IP from peered VPC network


These are the steps:

  • In "Project A" I have a "network A" with postgresql private IP in it.
  • Can access postgresql from VM existing in same "network A" through private IP.
  • Create a new "network B" in same "Project A"
  • Create a "VPC network peer" between "network A" and "network B"
  • Fully open firewall
  • Can't reach postgresql from "network B", though can ping VM existing on "network A"

Why i can't reach postgresql? Is it because SQL Private IP is in Beta mode, or i'm missing smth here?


Solution

  • Cloud SQL Private IP access is setup through peering so network A is peered with network Z, which contains your Cloud SQL instance. When you peer A with B, B does not have access to network Z.