Prerequisites
- The Admin role on the folder you’ll add the account to
- A gateway that can reach the database
- A PostgreSQL account template
Create the account
1
Go to Privileged Access Management > Accounts and select Add Account.
2
Select the Folder and a PostgreSQL Account Template, then select Next.
3
Enter a Name and the connection details:
If you have a connection string, such as
postgresql://user:password@host:5432/database, paste it into Host. Infisical fills in the other fields from the connection string, including the credentials.4
Select the Auth Method and enter the credentials:
- Password
- AWS IAM (RDS / Aurora)
5
Select Create.
AWS IAM authentication
With AWS IAM authentication, Infisical doesn’t store a password for the database user. Instead, Infisical assumes an IAM role in your AWS account and uses it to generate a short-lived authentication token for each connection. Set up the database and the IAM role before you create the account:1
In the RDS console, turn on IAM database authentication for the RDS instance or Aurora cluster.
2
Create the database user and grant it the
rds_iam role:3
Create an IAM role with the following trust policy:Replace the placeholders:
<INFISICAL_AWS_ACCOUNT_ID>:381492033652for Infisical Cloud (US),345594589636for Infisical Cloud (EU), or the ID of the AWS account that runs your instance if you self-host Infisical<YOUR_INFISICAL_ORG_ID>: your organization ID, which the tooltip on the Role ARN field shows
sts:ExternalId condition stops other Infisical organizations from using your role, so don’t remove it.4
Attach a policy to the role that lets it connect as the database user:
<DB_RESOURCE_ID> is the instance’s resource ID, which starts with db-, not the instance’s name. The RDS console shows the resource ID on the instance’s Configuration tab.- Host: the endpoint of the RDS instance or Aurora cluster, not a CNAME or other alias, because AWS signs each token for that exact endpoint
- SSL Enabled: always on, because IAM authentication requires TLS
- SSL Certificate: to verify the server, turn on Reject Unauthorized and paste the RDS certificate bundle for your region, such as
https://truststore.pki.rds.amazonaws.com/us-east-1/us-east-1-bundle.pem
PAM authentication failed for user, AWS rejected the token. Check that the rds-db:connect resource ARN uses the instance’s current resource ID, the right region, and the same database user as the account.
Connect
To open a session, follow Connect to an account.- Browser
- CLI
The browser session has a table browser, where you can view, filter, edit, and export rows, and a SQL editor for running queries.
Next steps
PostgreSQL credential rotation
Rotate the passwords of PostgreSQL accounts.
Sessions
Review and end the connections that people and agents make to your accounts.