vitoco has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I built a small local database in Postgres and use some perl scripts to load and update data, and then to extract for some reports. My scripts use the standard DBI module:
use DBI; $dbh = DBI->connect("dbi:Pg:dbname=mydb;host=localhost;port=5432;", $username, $password, {AutoCommit => 0, RaiseError => 1, PrintError => 0 +} );
Now, I have to move my local database model to an AmazonAWS Postgres database, which it is using an SSL tunnel (a second hostname and port). Also, as my localhost is outside of the HQ, I had to connect my box to there using a VPN in order to be able to access AWS.
I was given some credentials and a PEM file, so I can connect to that database server using the pgAdmin tool, but I cannot figure out how to implement that kind of connection in my scripts. I'm not sure if the sslmode connect string option is useful in this case...
Any idea on how to configure the connect string? Should I use another module as a wrapper?
Thanks...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connecting to a database in AWS using SSL
by NERDVANA (Priest) on May 30, 2025 at 18:24 UTC | |
|
Re: Connecting to a database in AWS using SSL
by vitoco (Hermit) on Jun 12, 2025 at 02:38 UTC | |
by hippo (Archbishop) on Jun 12, 2025 at 11:41 UTC |