-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgres - BTP hosted CAP application that uses an on-premise PostgreSQL database #523
Comments
I did a bit of research and I found out about this: https://github.com/piejanssens/sap-cf-socks This kind of scenario seems a bit foggy and everything I find doesn't cover our needs. |
Hi @FedericoBelotti-Reg, We leave this open, maybe someone from the community has made similar experiences and can help you out. |
Hi @patricebender , {
"requires":{
"db":{
"credentials":{
"host":"127.0.0.1", // This will be ignored if destination parameter has been provided
"port":5432, // This will be ignored if destination parameter has been provided
"user":"postgres",
"password":"password",
"database":"database-name",
"destination": "destination-name-on-the-btp"
},
"dialect": "postgres",
"impl": "@cap-js/postgres"
}
}
} Then, inside the // . . .
const dbc = new Client(...credentials, stream: new StreamBuilder(credentials.destination))
await dbc.connect()
// . . . This is only a suggestion and if the destination configuration could be integrated in the I'd like to know that you think and if this could be a useful contribution to the package, because for now we had to extend the Thanks! |
Hi @federicobelotti, great that you found a solution which works for you. Thanks |
Hi @federicobelotti, I had a quick look at It might be possible to achieve the same functionality with the |
Is it possible to talk with you about this? I tried to communicate a CAP with Postgree in AWS, but I didn't to resolve. |
Hi @YoshiakiToma, if you can reach the AWS hosted PostgreSQL DB with tools like DBeaver you should also be able to connect to it from CAP. This topic is about tunneling requests from SAP BTP to a PostgreSQL hosted on premise. |
Yes , I know @gregorwolf My AWS is closed to connect from external, so if I want to connect any internal API from AWS, I use the SAP Cloud Connector to connect between SAP BTP and AWS. This is possible because the cloud connector is installed in AWS Environment. |
Mabe the SAP Private Link Service could help you until the SOCKS5 proxy issue is solved. |
Hi @YoshiakiToma, @BobdenOs I didn't have much time to work again on the repo that I used to connect to an on-premise PostgreSQL database, but I plan to publish it as soon as I can so you can look at what I did. |
Hello,
the scenario we are trying to cover involves a CAP application hosted on the BTP in a Cloud Foundry environment that uses an on-premise PostgreSQL database that could be reached through the Cloud Connector hosted inside the same network as the on-premise database:
We setup a virtual host inside the Cloud Connector and a destination on the BTP space that points to that virtual host. However, no matter how we set up the config file for the database inside the CAP application, the database is not reachable (all I have is a timeout error).
I checked that either the virtual host or the destination where called when trying to read data, but I didn't find anything inside logs, so my guess is that the
@cap-js/postgres
plugin just searches for a publicly exposed host (or inside the same network) and I couldn't find a way to address the connection to the destination we created since the plugin doesn't take in account anydestination
parameter (or similar).Everything I could find was related to a psql database together with the use of an hyperscaler, which is not possible in this situation (in fact, inside the MTA deploy configuration of the application, we don't have any deploy or other related services).
Is it possible to achieve what we need with the official postgres plugin?
Thanks
The text was updated successfully, but these errors were encountered: