pgAdmin 4
pgAdmin 4 is a popular open-source tool for managing PostgreSQL databases. It provides a graphical interface that makes it easier to interact with PostgreSQL databases compared to using the command line. In this guide, we'll walk through the steps to connect pgAdmin 4 to a PostgreSQL database running in a staging/production RDS.
Step 1: Start the SSM Session to Your EC2 Instance.
Ensure that you have started the SSM session in a terminal.
aws ssm start-session \
--target [EC2-INSTANCE-ID] \
--document-name AWS-StartPortForwardingSessionToRemoteHost \
--parameters '{"host":["[HOST]"],"portNumber":["[DB-PORT]"],"localPortNumber":["[DB-PORT]"]}' \
--profile [PROFILE] \
--region [REGION] Step 2: Open pgAdmin 4
Open your pgAdmin 4 desktop app.
Step 3: Register a New Server
Right click on the Servers -> Register -> Server...

Step 4: General Tab
- Name:
dbnamefrom Secrets Manager

Step 5: Connection Tab
-
Host name/address: localhost
-
Port:
portfrom Secrets Manager -
Maintenance database:
dbnameSecrets Manager -
Username:
usernamefrom Secrets Manager -
Password:
passwordfrom Secrets Manager

Step 6: Check Database
Access database i.e. launchgoatStaging
