Postgres AWS RDS Connection Guide
Requirements
To connect Postgres with SimplyPut, you’ll need 5 main credentials: Host, Port, User, Password, and Database:
- Host
- Port
- User
- Password
- Database
Locating Credentials
Go to your Amazon RDS dashboard. Select the RDS instance containing the data you wish to connect with SimplyPut. This is where you will find the Host and Port information. Note: Make sure your host is publicly accessible. Choose the Database you’d like to connect with.
-- Create a new role
CREATE ROLE sp_role;
-- Create a new user and assign it to the role
CREATE USER sp_user PASSWORD '<your password you choose>' IN ROLE sp_role;
-- Grant USAGE privilege on schema(s) (e.g., public)
GRANT USAGE ON SCHEMA <your schema> TO sp_role;
GRANT USAGE ON SCHEMA information_schema TO sp_role;
-- Grant SELECT privilege on all tables in the schema
GRANT SELECT ON ALL TABLES IN SCHEMA <your schema> TO sp_role;
GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO sp_role;
-- Grant privileges on future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA <your schema> GRANT SELECT ON TABLES TO sp_role;
ALTER DEFAULT PRIVILEGES IN SCHEMA information_schema GRANT SELECT ON TABLES TO sp_role;
This script creates a new role `sp_role` and a new user `sp_user` with the password you choose. It then grants the `sp_role` USAGE and SELECT privileges on all existing and future tables in your chosen schema and the `information_schema`.
For views, you'll need to grant the privileges individually for each view like so:
GRANT SELECT ON <your schema>.view1 TO sp_role;
GRANT SELECT ON <your schema>.view2 TO sp_role;
-- and so on for each view
Replace `view1`, `view2`, etc. with the actual names of your views.
Remember, if you need to add SimplyPut to an allowlist for this connection, our IP address is 34.83.229.246 .