0.0.6 • Published 9 months ago

rds-node-pg v0.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

rds-node-pg

A wrapper utility tool to use node-postgres against RDS Cluster whose secret is managed by SecretsManager.

Key feature

Run database connection update upon the automatic secret rotation happening on the RDS side.

Required Permission

When this module is used on the AWS ECS, permission for the below commands is required.

  • DescribeDBClustersCommand for rds-cluster
  • GetSecretValueCommand for rds-cluster-secret

How to use

npm i rds-node-pg
import { RdsPGPool, getRDSClusterInfo } from "rds-node-pg";

const { masterUserSecretArn, endpoint } = await getRDSClusterInfo(
  "RDS_CLUSTER_NAME_HERE",
);

const pool = new RdsPGPool(endpoint, masterUserSecretArn, "DATABASE_NAME_HERE");

await pool.query(`
select * from your_table_name_here
`);

// at the end of the application
await pool.end();
0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago