1. Go to your deepnote workspace and click on Integrations
2. Click on SSH Key
3. Paste your private SSH key into the text area
You'll want to include your private key, not your public key here. Make you the bastion host you're using has your public key.
4. Click on Create integration
5. Click on PostgreSQL or any other database in the private network
6. Fill out the DB details and type "127.0.0.1" as host name
We're using 127.0.0.1
or localhost
here because we're going to establish an SSH link between the local machine and the bastion host later on.
7. Click on Create integration
8. Go back to your notebook or create a new one and click on Integrations
9. Connect your SSH Key
10. And connect your database
11. Click on How to use your SSH key
12. Copy the code snippet to the clipboard
13. Click on Environment on your right sidebar under Project
14. Create a new block and copy the code snippet from earlier
Remember to edit the IP address of the database in the private network first and then add the IP of the bastion host.