Hi all, :wave: I am looking to switch the SQLite s...
# plugins-general
d
Hi all, 👋 I am looking to switch the SQLite system database into a Postgres instance on AWS, which requires SSH tunnel to connect. Just wanted to check if that is currently supported within Meltano? There is an option of simply adding tunnel creation to
entrypoint
script, but I just wondered if anyone solved it differently? Thanks everyone!
t
If you’re able to put the info into the database URI then you should be able to. https://meltano.com/docs/settings.html#database-uri
d
Thank you for your response! I have looked through documentation and I don’t think that could be added to database URI, as i’s not part of connection string - it requires running an ssh server before connecting to database (https://www.postgresql.org/docs/8.2/ssh-tunnels.html). I will just add it as part of shell script.
a
@daria_olbinska did you get this working? I'd be interested to hear if you decided to use a shell script to open the SSH tunnel. If so, do you also close it once the tap has finished running? I was looking into this and saw that there's an unmerged PR for adding SSH tunnel support to Singer's own tap-postgres from a while ago: https://github.com/singer-io/tap-postgres/pull/90 To me, that seems like the most viable solution since the context for creating the tunnel can be handled in the tap itself
d
Hi Al, yes I ended up scripting opening SSH tunnel in the
entrypoint
and sending it to the background (I used combination of options
ssh -f -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes
as per this link). As I run it in Docker container it automatically closes at the end of the script (but it’s also possible to kill it).
a
@daria_olbinska thanks Daria! That sounds like a good approach, and that's a useful link - I'll give this a try
e
@gunnar @kai_yokoyama