/lambda-rds-to-csv

AWS Lambda function to export from RDS to S3

Primary LanguageJavaScriptMIT LicenseMIT

RDS to CSV on AWS Lambda

A Serverless project for exporting CSV data to S3, because trying to get AWS data pipeline working with Aurora was a lot of messing about.

Note that it is somewhat specific to my needs at this time (I'm accessing rows which all have a created_at column and need data a year at a time), but the basic building blocks might be useful to someone. Maybe?

Requirements

Usage

Installation

$ yarn

Run unit tests

Coming soon to a computer near you...

$ yarn test

Run a function on your local

$ serverless invoke local --function exportTable --data '{"table": "<table name>"}'

Deploy

$ serverless deploy

To add environment variables to your project

  1. Rename env.example to env.yml.
  2. Add environment variables for the various stages to env.yml.
  3. Uncomment environment: ${file(env.yml):${self:provider.stage}} in the serverless.yml.