Skip to content

Support a password function for the client configuration #2396

@benkeil

Description

@benkeil

If you use e.g. AWS Aurora Postgres with IAM authentication it is hard to deal with it in the code.

It would be nice that I can use a function to return the password, like this:

const signer: RDS.Signer = ...
const params: RDS.Signer.SignerOptions = ...

return new pg.Pool({
  max: 1,
  host: databaseConnection.clusterEndpoint,
  port: databaseConnection.port,
  database: databaseConnection.database,
  user: databaseConnection.username,
  password: async () => signer.getAuthToken(params),
  ssl: true,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions