- typescript - Typescript boilerplate
- javascript - Basic AWS Lambda Javascript boilerplate with ES2015+ support
- javascript-graphql - Basic AWS Lambda GraphQL boilerplate with ES2015+ support
- javascript-webhook-dynamodb - AWS Lambda / API Gateway Webhook with DynamoDB-persistence and ES2015+ support
- Prerequisites
- Setup
- IAM Credentials, Roles, and Permissions
- Development
- Deployment
- Invocation
- Logs
- How-to
You will need:
- An AWS IAM user account included in the
arn:aws:iam::000000000000:role/aws-lambda-basic-execution-rolerole.- The account must have MFA enabled
- You will need AWS Vault
Clone it. Yarn it.
yarnThen, make sure to change the service name in serverless.yml.
Yah. You need those.
@TODO
Any commands which interact with AWS APIs assume your IAM credentials are stored
in AWS Vault, and that the profile is
called allthings—ideally with MFA enabled.
@TODO: expand on this.
You will need to add the following to your ~/.aws/config file. Create it, if
it does not exist.
[profile allthings]
region = eu-west-1
mfa_serial = arn:aws:iam::000000000000:mfa/your.usernameyarn invoke:local myFunctionName --path event-mocks/scheduled-event.jsonor
yarn invoke:local myFunctionName --data '{"some": "eventData"}'yarn watch:testThen, develop and run code via tests. See src/handler.js and src/handler.test.js for examples.
You can also run the full test suite with coverage report:
yarn testyarn dev:offlineUses serverless-offline
yarn test:docker handler.hello '{"some": "eventData"}'Uses docker-lambda. Can also be used in tests:
import dockerLambda from 'docker-lambda'
const lambdaCallbackResult = dockerLambda({
event: { some: 'event' },
taskDir: __dirname,
dockerImage: 'lambci/lambda:nodejs6.10',
})Deploy entire service with all functions:
yarn deployTo manually invoke the deployed function from your terminal:
yarn invoke myFunctionName --path event-mocks/scheduled-event.jsonor
yarn invoke myFunctionName --data '{"some": "eventData"}'See logs for a function from CloudWatch in your terminal:
yarn logs myFunctionName