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


You can also check out my fully working project.

Related posts

Lambda updates
Haskell in AWS Lambda
AWS via Haskell Part 7 (SSM)
AWS via Haskell Part 6 (EC2)
AWS via Haskell Part 5 (Lambda)
AWS via Haskell Part 4 (SimpleDB)
AWS via Haskell Part 3 (SQS)
AWS via Haskell Part 2 (S3)
AWS via Haskell Part 1 (DynamoDB)



Content © 2024 Richard Cook. All rights reserved.