cancel
Showing results for 
Search instead for 
Did you mean: 

connect to a hyperscaler postgresql-db in a different org

timobermueller
Explorer

Hi experts,

we created an instance of the “postgresql-db” (“PostgreSQL, hyperscaler option”, plan "standard") service in a subaccount/org, lets call it “A”, on the Cloud Foundry BTP Platform. I can connect to the database running a node.js application in the same org/space or using a ssh tunnel on my local machine just fine.

But am I able to connect to the database from an application running in a space of a different org “B”? I created a “Service Key”, in org “A”, and imported this key in a space of org “B” via “Instances -> Create -> User-Provided Service Instance”.

My node.js application can read the properties of this key, but fails to connect to the database. Also it fails if I try to connect via

psql -h <hostname> -p <port> “dbname=<dbname> user=<username> sslrootcert=<> sslmode=verify-ca

on my local machine, like described in the help portal, with the parameters of the “Service Key”:

https://help.sap.com/viewer/b3fe3621fa4a4ed28d7bbe3d6d88f036/Cloud/en-US/1bd55b0b3d7340c88e381e786ed...

Can you guide me in the right direction? Is it even possible to connect to a postgres database instance when the client is not part of the org the postgres instance is running in.

Here is a quick drawing:

Error in node.js module "pg":

Error: connect ETIMEDOUT xx.xx.xx.xxx:2407 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: 'xx.xx.xx.xxx',
  port: 2407
}

Best regards
Tim

Hi, postgresql-db instance can be accessed only by the application running in the same cf-org/subaccount. There are org/space scoped security rules which allow service instance accessibility only from the same org.

timobermueller
Explorer
0 Kudos

Hi nishtha.srivastava,

Thank you very much for this helpful information! That takes me a great step further …

Have a nice day ….

Best regards
Tim

Accepted Solutions (0)

Answers (0)