Exporting Data from RDS Postgres to S3 with NodeJs & Lambda

This article provides an approach to streaming query output from RDS Postgres to an S3 CSV file via a NodeJs Lambda function.

The process uses pg-copy-streams and the query results to create a data stream which is piped to S3 using the aws-sdk.

Streaming Data from RDS/Postgres to S3 CSV using Lambda and NodeJs
Streaming Data from RDS/Postgres to S3 CSV using Lambda and NodeJs

Alternatives to removing the function’s dependency on pg-copy-streams were considered. These…