RDS and Aurora PostgreSQL
Last updated 25 November 2026
Use case: Private RDS over SSM
ARNscope lists the PostgreSQL databases in your account and connects to them with IAM database authentication: it asks AWS for a short-lived token and uses it as the password. There are no database passwords to type, store or rotate. Once connected you get a SQL console, a browsable object tree, query history and a query plan view.
A PostgreSQL database that RDS does not list (self-hosted, in another account, or behind a proxy) can be saved as a connection instead; see Saved PostgreSQL connections.
Which databases appear
Open RDS and choose a profile and region. ARNscope lists:
- RDS instance: standalone RDS for PostgreSQL instances (instances that belong to a cluster are reached through the cluster).
- Multi-AZ cluster: RDS for PostgreSQL Multi-AZ DB clusters.
- Aurora PostgreSQL: Aurora PostgreSQL clusters, with writer and reader endpoints.
MySQL, MariaDB and Aurora MySQL are listed too; see MySQL, StarRocks and ClickHouse. SQL Server, Oracle and Db2 are not listed.
Saved PostgreSQL connections
For a PostgreSQL database outside the RDS list, click Add database connection (+) at the top of the list and choose Engine: PostgreSQL (PostgreSQL, Aurora PostgreSQL). Saved connections appear under Saved connections in the list. They use the same form, routes, TLS rules and sign-in choices as the MySQL family, and they open the same console, read guard and Writes switch as a database from the RDS list.
| Setting | Choices |
|---|---|
| Connect through | ARNscope tunnel (one of your SSM tunnels, inside the app), My own tunnel (a Local port on 127.0.0.1 your tunnel forwards), or Direct (straight to the host, over a VPN, peering or office network) |
| Authentication | IAM (recommended, as above), a Secrets Manager secret (read fresh on each connect; only its ARN is saved), or a typed password (asked for each time, never saved) |
| TLS | RDS certificates (the default for *.rds.amazonaws.com hosts), System certificates (public certificate authorities), or Off |
| Port and database | 5432 by default. With no default database, ARNscope connects to postgres; the console’s database switcher reconnects to another. |
- Off (no TLS) is refused with IAM sign-in, and through an ARNscope tunnel unless the database runs on the tunnel’s own instance. With a password, Off sends it and every query in plain text.
- Host is always the real server name, even through a tunnel: TLS is checked against it, and an IAM token names it.
- A Secrets Manager secret can also supply the host, port, user and database on every connect (Use the secret’s details on every connect), so a moved database or a rotated password still connects. The Secrets Manager section describes the picker.
- Passwords are removed from any error message before it is shown.
IAM is still the best choice where the database supports it: no password to store, short-lived tokens and access in IAM (see Why IAM authentication). Use a secret or a typed password for a database that can’t use IAM, and a database user with read-only grants for read work.
Set up the database for IAM authentication
You do this once per database, outside ARNscope.
-
Enable IAM database authentication on the DB instance or cluster.
-
Create a database user and grant it the
rds_iamrole. Connect as the master user or another user who can create users and grant privileges:CREATE USER ops_readonly; GRANT rds_iam TO ops_readonly; GRANT CONNECT ON DATABASE commerce TO ops_readonly; GRANT USAGE ON SCHEMA public TO ops_readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO ops_readonly;The first two lines are what IAM authentication needs. The rest are ordinary PostgreSQL grants for what the user may read. What the IAM role can reach through the user is limited to what the database user can reach. The name must match the case of the name in the IAM policy.
-
Allow your IAM role to connect as that user with
rds-db:connect(next section).
A PostgreSQL user that has the rds_iam role must log in with IAM: password login stops working for it, including for the master user. See Creating a database account using IAM authentication.
The IAM permission
The role you sign in with needs rds-db:connect on the database user:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "rds-db:connect",
"Resource": "arn:aws:rds-db:us-east-1:123456789012:dbuser:db-ABCDEFGHIJKL01234/ops_readonly"
}]
}
The resource format is arn:aws:rds-db:<region>:<account-id>:dbuser:<DbiResourceId>/<database-user>. For an instance, DbiResourceId is its Resource ID (it starts with db- and does not change). For Aurora, use the cluster’s DbClusterResourceId. rds-db:connect is not an rds: action and does not appear in the console’s usual RDS permissions. See Creating and using an IAM policy for IAM database access.
Connect
- Open RDS, choose the database, and stay on the Connect tab.
- Choose the Mode: Read only or Write.
- If the database has a reader endpoint, choose what the tunnel forwards to: Writer endpoint or Reader endpoint.
- Choose how you reach the database (below).
- Enter the Database user and the Database, and click Connect.
ARNscope remembers each connection (user, database, mode and tunnel) under Previous connections on this Mac, so next time one click on Connect is enough. You can forget one with the trash button.
Through an ARNscope tunnel
If you have an SSM tunnel that forwards to this endpoint, a Tunnel picker appears with ARNscope tunnel and My own tunnel. Pick the tunnel and, if it is stopped, click Start tunnel (this opens an SSM session). ARNscope then connects inside the app and nothing listens on a local port. The tunnel must forward to the endpoint you chose, writer or reader. If you have an RDS tunnel that goes to a different endpoint, ARNscope tells you which one it reaches.
Through your own tunnel
Start your own tunnel (SSM, SSH or anything else) that forwards a local port to the endpoint and port shown on the page, then enter that Local tunnel port. ARNscope connects to 127.0.0.1 on that port and checks that something is listening. The TLS certificate is still checked against the RDS endpoint name, so use the real endpoint in the tunnel, not a custom DNS name.
What happens when you connect
- ARNscope generates an IAM authentication token with
aws rds generate-db-auth-tokenusing your profile and region, and uses it as the password. - The connection uses TLS and is required to. ARNscope trusts only the AWS RDS certificate authorities bundled with the app and verifies the endpoint name.
- Every session opens read-only, with
default_transaction_read_only=on, so the database rejects plain writes even if the user could write. ARNscope also sets it again before every statement, and checks each statement with PostgreSQL’s own parser before sending it. It refuses writes (including ones hidden in aWITH),SELECT … INTOandFOR UPDATE, statements that switch the session to read-write, and functions that run SQL from text, change settings, signal other sessions or reach outside the database (set_config,query_to_xml,pg_terminate_backend,dblink,lo_import, advisory locks, the RDSaws_s3andaws_lambdaextensions,httpand similar). - Writes are a switch in the console header, off by default. Turn it on and a native dialog shows the database user, host and database (PRODUCTION for a production profile). Choosing Write as the mode before connecting asks that same question right after you connect. Writes turn off again after 15 minutes without a write, when you turn them off or when you disconnect.
- If Writes turn off while a transaction you began with Writes on is still open, only
ROLLBACKruns on the session until you turn Writes on again. - The check is a guard, not the boundary. A view or function defined on the server can still do what its owner may do, and a read that calls it looks like a read. Use a database user that can only read for read work, and sign in with IAM so no password is stored.
- Turning Writes on and off, and refused writes, go to the local activity log without SQL text. See Writes and confirmations.
- The connection is checked with
SELECT 1every 30 seconds while the Databases page is in view. If it drops (a closed tunnel, sleep or a network change), the console shows Disconnected and a Reconnect button.
The SQL console
After connecting, the Query tab has:
| Feature | Details |
|---|---|
| Editor | SQL editor with highlighting and completion from the database’s objects: keywords (upper case), tables, views, functions and procedures, and the columns of the tables in the statement, each captioned with its table. A column that more than one of those tables has is inserted with the table’s alias, for example o.customer_id. Ctrl+Cmd+L formats the statement at the cursor, or the selection. Your text is saved per database on this Mac and survives restarts; it stays under SQL consoles even if the database goes away. |
| Run | Run executes the statement at the cursor, or the selection. Run all executes everything. Shortcut: Cmd+Enter. A single SELECT without LIMIT, FETCH or INTO gets LIMIT 500 added; write LIMIT ALL to get every row. |
| Results | A grid with sorting, copy and export. At most 1,000 rows and 1 MiB are kept per result; the header says when a result was cut. Several statements show several results. |
| Time limit | ARNscope sets none: a query runs until it finishes, the database’s own statement_timeout stops it, or you press Cancel. The toolbar shows how long the query has been running. |
| Transactions | Statements commit on their own (Auto-commit). Begin, Commit and Roll back group them, and the header shows Transaction open while one is open. |
| Explain | Explain plan shows the estimated plan as a diagram without running the statement; the most expensive step is marked in red. Explain analyze runs the statement and adds real timings and row counts, and where the planner’s estimate was off. It is refused, before anything runs, for anything but a plain SELECT (a SELECT with an INSERT, UPDATE, DELETE or MERGE in a WITH is refused too). |
| Database tree | Database objects on the right lists schemas, tables, views, functions, indexes and more, filterable. Open a table to browse 200 rows per page with a WHERE filter and sorting. View source shows an object’s definition. The tree is saved and refreshed on demand. |
| History | Query history keeps the last 500 statements per database on this Mac, as they ran (with an added LIMIT 500 or the EXPLAIN wrapper), with duration, row count and result. Click one to add it to the console. |
| Favourites | The star saves the statement at the cursor, with an optional label, under Favourites in the target list. A favourite remembers its profile, region, target and database: opening it switches there and adds the SQL to the console. It never runs on its own. |
| Switching | The database menu in the header switches to another database on the same server. |
o.customer_id.The Metrics and Top SQL tabs read CloudWatch and Performance Insights (or pg_stat_statements when connected). Metrics also opens as a panel beside the console, from the strip on the right. Top SQL can hand a statement to the console, which adds it for you to review and never runs it.
pg_stat_statements); Open in console adds one for review.Why IAM authentication
IAM authentication is the best way to sign in to a database from a tool like ARNscope:
- No long-lived password. Nothing to store, share, rotate or leak. ARNscope never sees or saves a database password.
- Short-lived tokens. An authentication token is valid for 15 minutes, and it is only used to open the connection: it does not limit how long an established session lasts. Temporary credentials must still be valid when you connect.
- Access in IAM. Grant and revoke access with IAM policies and roles, per database user, instead of managing it separately on each database. Access follows your SSO or role session.
- Encrypted. Traffic to the database is encrypted with TLS.
Be aware of the trade-offs, which AWS documents:
- RDS CloudTrail and CloudWatch do not log IAM database authentication, and they do not track
generate-db-auth-tokencalls. IAM controls who can connect, but connection attempts are not recorded in CloudTrail. Use database logs for that. - IAM authentication needs compute on the database. AWS recommends 300 to 1000 MiB of extra memory for reliable connections.
- It does not support all global condition keys, including
aws:SourceIp,aws:SourceVpcandaws:SourceVpce. - AWS recommends it as a mechanism for temporary, personal access, and not for workloads that open more than 256 new connections per second. A person using a console is the intended case.
Sources: IAM database authentication, Aurora IAM database authentication, and the AWS Database Blog post Use IAM authentication to connect with SQL Workbench/J for the connection-rate guidance.
Requirements
- For IAM sign-in, the AWS CLI installed. ARNscope runs
aws rds generate-db-auth-tokento create the token. It looks forawson the app’sPATH, then in/opt/homebrew/bin,/usr/local/binand/usr/bin. - An AWS profile that can sign in (SSO or keys). The token is signed with your credentials, which must still be valid when the connection opens.
- A route to the database: an ARNscope tunnel or a tunnel of your own, or, for a saved connection, a direct network path.
Permissions
| What | IAM actions |
|---|---|
| List databases | rds:DescribeDBInstances, rds:DescribeDBClusters |
| Connect with IAM | rds-db:connect on the database user (see above) |
| Connect with a secret (saved connections) | secretsmanager:ListSecrets to pick it, secretsmanager:GetSecretValue to read it |
| Metrics tab | rds:DescribeDBInstances, rds:DescribeDBClusters, cloudwatch:GetMetricData |
| Top SQL with Performance Insights | pi:GetResourceMetrics, pi:DescribeDimensionKeys, pi:GetDimensionKeyDetails |
| Start an ARNscope tunnel | See SSM tunnels |
The IAM permission check also lists secretsmanager:GetSecretValue next to connecting. Only saved connections that sign in with a secret need it.
Limitations
- IAM authentication for databases from the RDS list. Those connect with IAM only, and the database user needs the
rds_iamrole. To sign in with a Secrets Manager secret or a typed password, save the database as a connection. - This page covers PostgreSQL. RDS for PostgreSQL, Multi-AZ clusters and Aurora PostgreSQL. MySQL, MariaDB and Aurora MySQL are on their own page. SQL Server, Oracle and Db2 are not supported.
- Databases from the RDS list are reached through a tunnel. A saved connection can also connect Direct. ARNscope does not connect through RDS Proxy.
- IAM sign-in needs the AWS CLI. A secret or a typed password does not.
- Saved connections live on this Mac and are not synced between Macs. Metrics and Top SQL are for databases from the RDS list.
- Results are capped at 1,000 rows or 1 MiB, and statements over 1 MiB are refused. Use the table view or add
LIMITandOFFSETfor more. - The read check refuses a few harmless functions along with the risky ones (for example,
nextvaland the advisory-lock functions), because it cannot tell what they will do. Turn on Writes for the session to run them. - Explain analyze only analyzes a single plain
SELECT. To analyze a write, typeEXPLAIN (ANALYZE, FORMAT JSON)yourself insideBEGIN … ROLLBACK. - A single
SELECTwithout aLIMITstops at 500 rows unless you writeLIMIT ALL; results are still capped at 1,000 rows or 1 MiB. - ARNscope keeps one database connection open at a time. Connecting to another database, or switching databases on the server, closes the current one.
- Database connections are available in the desktop app only, not in the web preview.
Need another mode? Write to hello@arnscope.com and tell us what you use.