1.0.5 • Published 4 years ago
brightpearl-cache v1.0.5
BuildDirect Lambda Typescript Starter
Key NPM commands
npm ci-- Install dependencies frompackage-lock.jsonfor more repeatable buildsnpm run build-- Build the javascript into the build folder.npm run lint-- Run TSLint.npm run lint:fix-- Run TSLint Fixersnpm test-- Run all tests with coverage.npm run test:unit-- Run all unit testsnpm run test:integration-- Run all integration testsnpm run local-- Run the function locally.
Setup
- Setup the AWS CLI by running
aws configureusing security credentials from your AWS IAM console - Ensure that
[default]is added at the top of your AWS config file~/.aws/credentials - Ensure you are logged into a BuildDirect NPM account to run
npm install - Edit
./awsEvent.tsand create a type for the SQS Event your lambda function will be processing - Add a primary identifier (Order ID, User etc) to the logging tags in
./src/index.ts - Consult logging package docs and determine the interval/batchSize to set. Default setup is only send logs in batches once per invocation.
- Add your function name to
./src/constants.tsand./buildspec.yml - Add your function specific secret keys to
setupSecrets()inindex.ts