serverless-haskell 0.7.1 → 0.7.2
raw patch · 3 files changed
+56/−50 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +4/−1
- serverless-haskell.cabal +2/−2
- src/AWSLambda.hs +50/−47
README.md view
@@ -30,8 +30,11 @@ ```shell cd mypackage npm init .- npm install --save serverless serverless-haskell+ npm install --save serverless serverless-haskell@x.y.z ```++ The version of the NPM package to install must match the version of the+ Haskell package. * Create `serverless.yml` with the following contents:
serverless-haskell.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: e9eb1aebf501f16a5163b0fe3ba4cc19e77994838f439cbe190664c88d605c21+-- hash: 8fd19c3b3da30859e519e1898752a1484a6e57ae28d4125bab5b93a5dfc0c6c7 name: serverless-haskell-version: 0.7.1+version: 0.7.2 synopsis: Deploying Haskell code onto AWS Lambda using Serverless description: Utilities to help process the events from AWS Lambda when deployed with the serverless-haskell plugin. category: AWS, Cloud, Network
src/AWSLambda.hs view
@@ -10,42 +10,45 @@ To deploy a Haskell function on AWS Lambda: * Initialise a Serverless project in the same directory as your Stack-enabled- package and install the @serverless-haskell@ plugin:+package and install the @serverless-haskell@ plugin: - > npm init .- > npm install --save serverless serverless-haskell+ > npm init .+ > npm install --save serverless serverless-haskell@x.y.z + The version of the NPM package to install must match the version of the+ Haskell package.+ * Create @serverless.yml@ with the following contents: - > service: myservice- >- > provider:- > name: aws- > runtime: nodejs8.10- >- > functions:- > myfunc:- > handler: mypackage.mypackage-exe- > # Here, mypackage is the Haskell package name and mypackage-exe is the- > # executable name as defined in the Cabal file- >- > plugins:- > - serverless-haskell+ > service: myservice+ >+ > provider:+ > name: aws+ > runtime: nodejs8.10+ >+ > functions:+ > myfunc:+ > handler: mypackage.mypackage-exe+ > # Here, mypackage is the Haskell package name and mypackage-exe is the+ > # executable name as defined in the Cabal file+ >+ > plugins:+ > - serverless-haskell * Write your @main@ function using 'AWSLambda.lambdaMain'. * Use @sls deploy@ to deploy the executable to AWS Lambda. __Note__: @sls deploy- function@ is- <https://github.com/seek-oss/serverless-haskell/issues/20 not supported yet>.+function@ is+<https://github.com/seek-oss/serverless-haskell/issues/20 not supported yet>. - The @serverless-haskell@ plugin will build the package using Stack and upload- it to AWS together with a JavaScript wrapper to pass the input and output- from/to AWS Lambda.+ The @serverless-haskell@ plugin will build the package using Stack and upload+ it to AWS together with a JavaScript wrapper to pass the input and output+ from/to AWS Lambda. - You can test the function and see the invocation results with @sls invoke- myfunc@.+ You can test the function and see the invocation results with @sls invoke+ myfunc@. - To invoke the function locally, use @sls invoke local -f myfunc@.+ To invoke the function locally, use @sls invoke local -f myfunc@. = API Gateway @@ -62,37 +65,37 @@ section of @serverless.yml@. * To add flags to @stack build@, specify them as an array under- @stackBuildArgs@:+@stackBuildArgs@: - > custom:- > haskell:- > stackBuildArgs:- > - --pedantic- > - --allow-different-user+ > custom:+ > haskell:+ > stackBuildArgs:+ > - --pedantic+ > - --allow-different-user * To start the executable with extra arguments, add them to @arguments@ under- the function name:+the function name: - > custom:- > haskell:- > arguments:- > myfunc:- > - --arg1- > - --arg2- > - arg3+ > custom:+ > haskell:+ > arguments:+ > myfunc:+ > - --arg1+ > - --arg2+ > - arg3 * Dependent system libraries not present in the AWS Lambda environment will be- automatically uploaded along with the executable. Note that while statically- linking the executable via Cabal options is possible, it might still require- the corresponding glibc version on the AWS environment.+automatically uploaded along with the executable. Note that while statically+linking the executable via Cabal options is possible, it might still require+the corresponding glibc version on the AWS environment. * Stack's Docker image will be used to match the AWS Lambda Linux environment.- To disable this, set @docker@ key to @false@, but beware that the resulting- binary might not have the required libraries to run on Lambda.+To disable this, set @docker@ key to @false@, but beware that the resulting+binary might not have the required libraries to run on Lambda. - > custom:- > haskell:- > docker: false+ > custom:+ > haskell:+ > docker: false -} module AWSLambda ( Handler.lambdaMain