Skip to content

Instantly share code, notes, and snippets.

@bendalby82
Created September 25, 2020 15:51
Show Gist options
  • Save bendalby82/5bdccc8f689f5248f50be27e634c8172 to your computer and use it in GitHub Desktop.
Save bendalby82/5bdccc8f689f5248f50be27e634c8172 to your computer and use it in GitHub Desktop.
Create Node.js layer to simplify connecting AWS Lambda to PostgreSQL
#!/usr/bin/env bash
#https://medium.com/coinmonks/connecting-aws-lambda-node-js-to-redshift-or-postgresql-try-aws-lambda-layers-78e60c27f39b
#Note the name of the folder *must* be nodejs, see explanation here:
#https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html
mkdir nodejs
cd nodejs
npm init -y
npm install --save pg
cd ..
zip -r nodejs.zip nodejs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment