A lightweight Node.js library that generates AWS RDS IAM authentication tokens and creates secure PostgreSQL connections. Current stable version: 1.0.6, with low release cadence. It handles the token generation, SSL enforcement, and connection parameter configuration automatically, reducing the boilerplate for RDS IAM auth. Compared to manually using the AWS SDK and pg library, it provides a single function call to get a fully configured pool or client.
npm install aws-secure-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import SecurePostgres, create an instance with RDS connection details, get a configured pg.Pool, and run a query.
Use a different library or manually configure IAM auth with the AWS SDK.
Consider using the AWS SDK v3 and pg directly, or check for updates.
Validate that region, host, dbUser, and database are provided and correct before creating the instance.
Implement token refresh logic using the getPool() method or manually refresh tokens before expiration.
Use const SecurePostgres = require('aws-secure-postgres').default;Double-check the RDS endpoint hostname. Ensure the instance is in the same VPC and security groups allow inbound connections.
Ensure the RDS instance has IAM authentication enabled and the database user has the appropriate permissions. Then generate a new token.