npm.io
2.1.0 • Published 2 years ago

rds-iam-pg

Licence
Apache-2.0
Version
2.1.0
Deps
0
Size
192 kB
Vulns
0
Weekly
0
Stars
2

rds-iam-pg

Convenience functions for connecting to RDS Postgres using IAM auth.

The createRdsPgPool() function uses AWS credentials present in the environment or filesystem to create a signed token to authenticate with RDS Postgres using IAM authentication.

It works in Lambda and any other Node environment.

Usage

import { createRdsPgPool } from 'rds-iam-pg'

const pgPool = createRdsPgPool({
  awsRegion: 'us-east-1',
  awsProfile: process.env.AWS_PROFILE,
  address: {
    host: 'your.rds.hostname.aws'
    port: 5432,
    user: 'yourusername',
    database: 'yourdb',
  },
})

License

This project is licensed under the Apache license, version 2.0.