Skip to content
An extension for running Probot on Lambda
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests update test to ensure it passes when headers are capitalized Mar 16, 2019
views
.gitignore Init Mar 25, 2018
README.md Call out custom routes usage gotcha Mar 6, 2019
index.js fix: undefined event name in webhook handler Jan 14, 2019
package-lock.json chore: bump dependencies Mar 16, 2019
package.json chore: bump dependencies Mar 16, 2019

README.md

AWS Lambda Extension for Probot

A Probot extension to make it easier to run your Probot Apps in AWS Lambda.

Usage

$ npm install @probot/serverless-lambda
// handler.js
const { serverless } = require('@probot/serverless-lambda')
const appFn = require('./')
module.exports.probot = serverless(appFn)

Configuration

This package moves the functionality of probot run into a handler suitable for usage on AWS Lambda + API Gateway. Follow the documentation on Environment Configuration to setup your app's environment variables. You can add these to .env, but for security reasons you may want to use the AWS CLI or Serverless Framework to set Environment Variables for the function so you don't have to include any secrets in the deployed package.

For the private key, since AWS environment variables cannot be multiline strings, you could Base64 encode the .pem file you get from the GitHub App or use KMS to encrypt and store the key.

Differences from probot run

Local Development

Since Lambda functions do not start a normal node process, the best way we've found to test this out locally is to use serverless-offline. This plugin for the serverless framework emulates AWS Lambda and API Gateway on your local machine, allowing you to continue working from https://localhost:3000/probot before deploying your function to AWS.

Long running tasks

Some Probot Apps that depend on long running processes or intervals will not work with this extension. This is due to the inherent architecture of serverless functions, which are designed to respond to events and stop running as quickly as possible. For longer running apps we recommend using other deployment options.

If you use HTTP routes or WEBHOOK_PATH

This extension is designed primarily for receiving webhooks from GitHub and responding back as a GitHub App. If you are using HTTP Routes in your app to serve additional pages, you should take a look at serverless-http, which can be used with Probot's express server by wrapping probot.server.

You can’t perform that action at this time.