ike
ike

Reputation: 312

AWS/RDS rejecting file import from pgAdmin

I'm using pgAdmin to connect to my RDS instance, which has an ssh tunnel through a vpc. That element is mostly fine; I can connect, and query the tables, and create tables. The issue is the I can not import CSVs into the newly created tables; the import wizard is rejected with 'exit code 2' (connection rejected).

I've tried opening a new port specifically to Postgres traffic, but no dice. this seems like it should be fairly basic; I can do it in my RDS instance that doesn't have SSH no problem (succeeded with the same file, same terminal, etc). It really seems like a basic item but I can't seem to even find a guide.

EDIT/Addition: I've made some progress. if I run a command like so:

ssh -N -L 1234:<rds-endpoint>:5432 ec2-user@<ec2-public-ip-addres> -i /Users/user/.ssh/permissionsfile.pem

and then in pgadmin run as a normal connection to:

host: localhost 
port: 1234 
username: rds-username
maintenancedatabasae: rds-database
password: rds-usernames-password

this works. I'm mostly just baffled that I can't figure out how to put that same ssh info into pgadmin. typically it's a super simple copy and paste operation.

Upvotes: 4

Views: 325

Answers (1)

First, if RDS is located in private subnet, pgAdmin cannot connect to RDS even if the private subnet is connected to NAT Gatway which is in public subnet. So to make the private subnet public, set Internet Gateway to the private subnet instead of NAT Gatway.

Second, check the security group's inbound rule of 5432(RDS postgresql port) is open to your computer which has pgAdmin.

Third, check Public access of RDS setting is Yes showing below. If it's No, tools outside your VPC cannot connect to RDS.

enter image description here

Tell me you could successfully connect to RDS with pgAdmin or not with 3 solutions above.

Upvotes: 1

Related Questions