Package Exports
- @probot/adapter-aws-lambda-serverless
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@probot/adapter-aws-lambda-serverless) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@probot/adapter-aws-lambda-serverless
Adapter to run a Probot application function in AWS Lambda using the Serverless Framework
Usage
npm install @probot/adapter-aws-lambda-serverless
// handler.js
const {
createLambdaFunction,
createProbot,
} = require("@probot/adapter-aws-lambda-serverless");
const appFn = require("./");
module.exports.webhooks = createLambdaFunction(appFn, {
probot: createProbot(),
});
Configuration
You need to add environment variables to configure Probot to your Lambda function. If you use the Serverless App, you can add parameters for APP_ID
, PRIVATE_KEY
, WEBHOOK_SECRET
, the use these parameters in serverless.yaml
.
provider:
name: aws
runtime: nodejs12.x
lambdaHashingVersion: 20201221
environment:
APP_ID: ${param:APP_ID}
PRIVATE_KEY: ${param:PRIVATE_KEY}
WEBHOOK_SECRET: ${param:WEBHOOK_SECRET}
NODE_ENV: production
LOG_LEVEL: debug
functions:
webhooks:
handler: handler.webhooks
events:
- httpApi:
path: /api/github/webhooks
method: post
Make sure to configure your GitHub App registration's webhook URL to <your lambda's URL>/api/github/webhooks
.
Examples
- example-aws-lambda-serverless - Official example application that is continuously deployed to AWS Lambda
Add yours!