Skip to content
Lambda function to pull data from Postgres DB and dump to Google Spreadsheet
JavaScript
Branch: master
Clone or download
Latest commit 5e129c8 Jan 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore First commit. Lambda sheets skeleton Jan 2, 2019
README.md
config.json
googleapi.js First commit. Lambda sheets skeleton Jan 2, 2019
handler.js
package-lock.json First commit. Lambda sheets skeleton Jan 2, 2019
package.json
pgClient.js First commit. Lambda sheets skeleton Jan 2, 2019
serverless.yml

README.md

lambda-google-sheets

Lambda function to pull data from Postgres database and dump to Google Spreadsheet

More context in this blog post

Installation

Clone the repository and run

$ npm install
$ npm install -g serverless

Make sure the environment variables as present in pgClient.js are populated correctly.

Configuration

Review the contents of config.json to add the source of importing data.

Testing Locally

Make sure you have the following setup in place on ur machine before executing the script:

  • have node 8.10 runtime or higher
  • you have a local tunnel to DWH available on port 5439
  • you have the AWS KEY and SECRET available in ~/.aws/credentials
$ SLS_DEBUG=* serverless invoke local --function lambda_sheets

Deployment

To deploy the function to AWS, make sure aws_access_key_id, aws_secret_access_key and region are passed as environment vars to deploy command or configured in ~/.aws/config

$ serverless deploy

The deployment script should exit with status code 0.

You can’t perform that action at this time.