How to connect Google managed Postgres SQL Databas…


Hello Experts,

Are there any resources that I can follow to connect CloudSQL Postgres Database (in VPC-A) from VPC-B.

I see that VPC-A has “Private Service Access” created when I enabled the PrivateIP for the database.

Screenshot Capture - 2024-02-25 - 05-11-54.png

 

I have another vpc say VPC-B, in a different Project and Organization, which I want to connect to this Database. So far I have done vpc peering between VPC-A and VPC-B. I have also set ingress and egress firewall rules to allow-all. However I am still unable to connect to the database.

Running network connectivity test from the VM in VPC-B to Database shows following:

network_connectivity_test_gcp_feb25.png

 

From above it seems  that instead of sending the request to the peered network hop the request is being routed to “internet gateway”. The issue happens only with database. Testing anyother VM in vpc-a correctly shows the “peering vpc” as the next hop.

network_connectivity_vm_test_Feb25png.png

 

I am suspecting the above routing issue has something to do with “Private Service Access” endpoint created for the database. However I am not sure how to proceed here and fix the issue.

Any help will be appreciated. Thanks.



Source link

Leave a Comment