Datastream connexion to PostgreSQL DB inside a VM

Hello,

I'm trying to create a connexion profile in Datastream

- internal ip address of the VM

-PORT : 8060 (opened in firewall)

-user/pwd

-database name

I have opened the port 8060 in the firewall for the allowlist ip addresses.

The connexion fails with the error

We timed out trying to connect to the data source. Make sure that the hostname and port configuration is correct and that the data source is available. 

In the logging i see 

status{
code7
message"Internal error."
}
}
 
With pgadmin, i can connect to the Database locally with an iap-tunnel on port 8060, i can't figure out why in Datastream it fails to connect.
 
Thank you
 
Solved Solved
0 1 274
1 ACCEPTED SOLUTION

Good day @AlaB,

Welcome to Google Cloud Community!

It is possible that you are encountering this error since you are using an internal IP address, to solve this problem you can try using the public IP address, please note that for IP allowlists, if your database is external to Google Cloud and your external IP address and TCP port is accessible, Public connectivity is the most suitable. You can check this link for more information: https://cloud.google.com/datastream/docs/network-connectivity-options#ipallowlists
For more information on how to create a connection profile for postgreSQL DB:
https://cloud.google.com/datastream/docs/create-connection-profiles#cp4postgresdb

But if you are trying to set up a private connection between a VPC and Datastreams private network, I would suggest that you follow this guide on how to use the internal IP addresses that will enable Datastream to communicate with the resources: https://cloud.google.com/datastream/docs/private-connectivity

Hope this helps!

View solution in original post

1 REPLY 1

Good day @AlaB,

Welcome to Google Cloud Community!

It is possible that you are encountering this error since you are using an internal IP address, to solve this problem you can try using the public IP address, please note that for IP allowlists, if your database is external to Google Cloud and your external IP address and TCP port is accessible, Public connectivity is the most suitable. You can check this link for more information: https://cloud.google.com/datastream/docs/network-connectivity-options#ipallowlists
For more information on how to create a connection profile for postgreSQL DB:
https://cloud.google.com/datastream/docs/create-connection-profiles#cp4postgresdb

But if you are trying to set up a private connection between a VPC and Datastreams private network, I would suggest that you follow this guide on how to use the internal IP addresses that will enable Datastream to communicate with the resources: https://cloud.google.com/datastream/docs/private-connectivity

Hope this helps!