admin管理员组

文章数量:1122846

I have an AWS RDS that I'm accessing securely via AWS SSM and Bastion. I do the following to start an AWS session:

  1. In my terminal, set AWS session credentials
  2. Run AWS SSM: aws ssm start-session --target bastion-instance-id --region my-region --document-name AWS-StartPortForwardingSessionToRemoteHost --parameters '{"host": ["awsrdsurl.rds.amazonaws"], "portNumber":["5432"], "localPortNumber": ["5896"]}'
  3. I get the following:
    • Starting session with SessionId: session-id
    • Port 5896 opened of sessionId session-id
    • Waiting for connections...

I am able to connect to the session using psql: psql -h localhost -p 5896 -U my-db-username -d my-db-name. This indicates to me that the port forwarding is working.

I'm not able to connect to the session using pgAdmin, it gives me "Unable to connect to server: connection timeout expired".

My "Connection" tab has:

  • Host name/address: localhost
  • Port: 5896
  • Maintenance database: my-db-name
  • Username: my-db-username
  • Password: my-db-password

My "Parameters" tab has:

  • "Connection timeout (seconds)" with value 120

I've tried connection timeout up to 300s and it's the same thing.

When I try to connect, I'm not connected to the SSM session with psql so it's the only connection attempt to the SSM session.

The above worked at one point, I had the server connection set up in pgAdmin for a couple months ago and I had removed it today to walk through setting it up from scratch and this happened. I've also updated to the latest version of pgAdmin (v8.13).

I'm not sure what I should be checking and if I'm completely missing something in my setup, any help/advice would be greatly appreciated!

本文标签: postgresqlAWS RDS Connection with SSM and BastionpgAdmin Connection TimeoutStack Overflow