HLambda

2018-02-24

Another quick one! I thought I’d sit down and figure out how to run some Haskell code in AWS Lambda. I took a look at the serverless-haskell package and thought I’d show you the fruits of my investigation. My project makes uses of the AWSHaskell module from serverless-haskell but dispenses with all the npm stuff. Right now, you just run the pkg script which will generate a zip archive in the right format for AWS Lambda which you can then upload. Note that you’ll need to build on Linux to generate compatible binaries for use on Lambda. Done.

Part 1: Main.hs

Part 2: hlambda.cabal

Part 3: index.js

Part 4: pkg

Part 5: stack.yaml

Done

You can also check out my fully working project.

Tags: Haskell, AWS, Lambda, Serverless

All content © 2018 Richard Cook. All rights reserved.