Home

Awesome

Serverless Haskell

Build status Hackage Stackage LTS Hackage dependencies npm

Deploying Haskell code onto AWS Lambda as native runtime using Serverless.

Prerequisites

Usage

There are two ways to start, either via the stack template, or directly modifying a project. You may want to use the manual approach as the template specifies a specific stack resolver as it needs to hardcode the stack.yaml file.

In either case, you will want to have Serverless installed, eg. npm install -g serverless.

Using the stack template

Manually

API Gateway

This plugin supports handling API Gateway requests. Declare the HTTP events normally in serverless.yml and use AWSLambda.Events.APIGateway in the handler to process them.

Serverless Offline can be used for local testing of API Gateway requests. You must use --useDocker flag so that the native Haskell runtime works correctly.

When using Serverless Offline, make sure that the project directory is world-readable, otherwise the started Docker container will be unable to access the handlers and all invocations will return HTTP status 502.

Notes

See AWSLambda for documentation, including additional options to control the deployment.

Development

master branch is the stable version. It is normally released to Hackage once new changes are merged via Git tags.

The package is also maintained in Stackage LTS, provided the dependencies are not blocking it.

Testing

Integration tests

Integration test verifies that the project can build and deploy a complete function to AWS, and it runs with expected functionality.

Integration test is only automatically run up to deployment due to the need for an AWS account. To run manually:

Releasing