Code Monkey home page Code Monkey logo

aws-lambda-haskell-runtime's Introduction

aws-lambda-haskell-runtime's People

Contributors

andys8 avatar dnikolovv avatar fcracker79 avatar glammers1 avatar harrypunk avatar jazcarate avatar jp8t-wltr avatar kalm004 avatar lazybrush avatar michaelpj avatar ncaq avatar nickseagull avatar oddvars avatar ohe avatar pparkkin avatar rimmington avatar stevemao avatar sumo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-lambda-haskell-runtime's Issues

sample lambda function instructions don't work

OS:
10.12.6 (16G1815)

Haskell:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.

Docker:
$ docker --version
Docker version 18.09.2, build 6247962

output

$ stack docker pull
Pulling image from registry: 'fpco/stack-build:lts-12.13'
lts-12.13: Pulling from fpco/stack-build
b234f539f7a1: Pull complete 
55172d420b43: Pull complete 
5ba5bbeb6b91: Pull complete 
43ae2841ad7a: Pull complete 
f6c9c6de4190: Pull complete 
52b26204f9af: Pull complete 
916b6abf261c: Pull complete 
048ddb5a0825: Pull complete 
db66cbec7a84: Pull complete 
7b52cdfbea02: Pull complete 
a5dc6aa43eaa: Pull complete 
Digest: sha256:a2dd000418803767b528b51e5eb465f6e1a6cb8d403452e2aee0a01a8f496901
Status: Downloaded newer image for fpco/stack-build:lts-12.13
$ make 
Downloading Docker-compatible stack executable
Querying for archive location for platform: linux-x86_64-static
Downloading from: https://github.com/commercialhaskell/stack/releases/download/v1.9.3/stack-1.9.3-linux-x86_64-static.tar.gz
Download complete, testing executable

Warning: Installation path
         /Users/jonoabroad/.stack/programs/x86_64-linux/stack-1.9.3
         not found on the PATH environment variable.
New stack executable available at /Users/jonoabroad/.stack/programs/x86_64-linux/stack-1.9.3/stack
Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

[1 of 2] Compiling Main             ( /Users/jonoabroad/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/jonoabroad/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim   ( /Users/jonoabroad/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/jonoabroad/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/jonoabroad/.stack/setup-exe-cache/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/tmp-Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 ...
Only-0.1: download
Only-0.1: configure
base-compat-0.10.4: download
base-orphans-0.7: download
SHA-1.6.4.4: download
Only-0.1: build
base-orphans-0.7: configure
base-orphans-0.7: build
base-compat-0.10.4: configure
Only-0.1: copy/register
base-compat-0.10.4: build
SHA-1.6.4.4: configure
base-orphans-0.7: copy/register
SHA-1.6.4.4: build                                                              base16-bytestring-0.1.1.6: download                                             base16-bytestring-0.1.1.6: configure                                            base64-bytestring-1.0.0.1: download                                             base16-bytestring-0.1.1.6: build                                                base64-bytestring-1.0.0.1: configure                                            base64-bytestring-1.0.0.1: build                                                base16-bytestring-0.1.1.6: copy/register                                        basement-0.0.8: download                                                        base64-bytestring-1.0.0.1: copy/register                                        basement-0.0.8: configure                                                       base-compat-0.10.4: copy/register                                              
basement-0.0.8: build                                                          
byteable-0.1.1: download                                                       
byteable-0.1.1: configure                                                      
byteable-0.1.1: build                                                          
byteable-0.1.1: copy/register                                                  
call-stack-0.1.0: download                                                     
call-stack-0.1.0: configure                                                  
cereal-0.5.7.0: download                                                     
call-stack-0.1.0: build                                                      
cereal-0.5.7.0: configure                                                    
cereal-0.5.7.0: build                                                        
call-stack-0.1.0: copy/register                                              
colour-2.3.4: download                                                       
colour-2.3.4: configure                                                  
colour-2.3.4: build                                                      
colour-2.3.4: copy/register                                              
ansi-terminal-0.8.1: download                                                   
ansi-terminal-0.8.1: configure                                                  
ansi-terminal-0.8.1: build                                                      
cereal-0.5.7.0: copy/register                                                   
cryptohash-md5-0.11.100.1: download                                             cryptohash-md5-0.11.100.1: configure                                            cryptohash-md5-0.11.100.1: build                                                ansi-terminal-0.8.1: copy/register                                              cryptohash-md5-0.11.100.1: copy/register                                        ansi-wl-pprint-0.6.8.2: download                                                ansi-wl-pprint-0.6.8.2: configure                                               cryptohash-sha1-0.11.100.1: download                                            ansi-wl-pprint-0.6.8.2: build                                                   cryptohash-sha1-0.11.100.1: configure                                           cryptohash-sha1-0.11.100.1: build                                               ansi-wl-pprint-0.6.8.2: copy/register                                           cryptohash-sha1-0.11.100.1: copy/register                                       SHA-1.6.4.4: copy/register                                                      data-default-class-0.1.2.0: download                                            data-default-class-0.1.2.0: configure                                           dlist-0.8.0.5: download                                                         data-default-class-0.1.2.0: build                                               dlist-0.8.0.5: configure                                                        hourglass-0.2.12: download                                                      data-default-class-0.1.2.0: copy/register                                       dlist-0.8.0.5: build                                                            hourglass-0.2.12: configure                                                     hourglass-0.2.12: build                                                         data-default-instances-containers-0.0.1: download                               dlist-0.8.0.5: copy/register                                                    data-default-instances-containers-0.0.1: configure                              data-default-instances-containers-0.0.1: build                                  data-default-instances-dlist-0.0.1: download                                    data-default-instances-containers-0.0.1: copy/register                          data-default-instances-dlist-0.0.1: configure                                   data-default-instances-dlist-0.0.1: build                                       data-default-instances-dlist-0.0.1: copy/register                               integer-logarithms-1.0.2.2: download                                            integer-logarithms-1.0.2.2: configure                                           integer-logarithms-1.0.2.2: build                                               microlens-0.4.9.1: download                                                     microlens-0.4.9.1: configure                                                    microlens-0.4.9.1: build                                                        integer-logarithms-1.0.2.2: copy/register                                       network-2.6.3.6: download                                                       microlens-0.4.9.1: copy/register                                                network-2.6.3.6: configure                                                      microlens-ghc-0.4.9.1: download                                                 basement-0.0.8: copy/register                                                   hourglass-0.2.12: copy/register                                                 memory-0.14.18: download                                                        network-info-0.2.0.10: download                                                 network-2.6.3.6: build                                                          microlens-ghc-0.4.9.1: configure                                                memory-0.14.18: configure                                                       microlens-ghc-0.4.9.1: build                                                    memory-0.14.18: build                                                           network-info-0.2.0.10: configure                                                network-info-0.2.0.10: build                                                    microlens-ghc-0.4.9.1: copy/register                                            network-info-0.2.0.10: copy/register                                            old-locale-1.0.0.7: download                                                    old-locale-1.0.0.7: configure                                                   old-locale-1.0.0.7: build                                                       parallel-3.2.2.0: download                                                      parallel-3.2.2.0: configure                                                     parallel-3.2.2.0: build                                                         old-locale-1.0.0.7: copy/register                                               data-default-instances-old-locale-0.0.1: download                               data-default-instances-old-locale-0.0.1: configure                              parallel-3.2.2.0: copy/register                                                 data-default-instances-old-locale-0.0.1: build                                  data-default-instances-old-locale-0.0.1: copy/register                          network-2.6.3.6: copy/register                                                  primitive-0.6.3.0: download                                                     primitive-0.6.3.0: configure                                                    memory-0.14.18: copy/register                                                   data-default-0.7.1.1: download                                                  primitive-0.6.3.0: build                                                        data-default-0.7.1.1: configure                                         
random-1.1: download                                                    
data-default-0.7.1.1: build                                                     random-1.1: configure                                                           data-default-0.7.1.1: copy/register                                             asn1-types-0.3.2: download                                                      asn1-types-0.3.2: configure                                                     random-1.1: build                                                               asn1-types-0.3.2: build                                                         cryptonite-0.25: download                                                       cryptonite-0.25: configure                                                      cryptonite-0.25: build                                                          asn1-types-0.3.2: copy/register                                                 primitive-0.6.3.0: copy/register                                                asn1-encoding-0.9.5: download                                                   asn1-encoding-0.9.5: configure                                                  random-1.1: copy/register                                                       asn1-encoding-0.9.5: build                                                      pem-0.2.4: download                                                             pem-0.2.4: configure                                                            reflection-2.1.4: download                                                      pem-0.2.4: build                                                                reflection-2.1.4: configure                                                     reflection-2.1.4: build                                                         pem-0.2.4: copy/register                                                        asn1-encoding-0.9.5: copy/register                                              semigroups-0.18.5: download                                                     semigroups-0.18.5: configure                                                    asn1-parse-0.9.4: download                                                      semigroups-0.18.5: build                                                        asn1-parse-0.9.4: configure                                                     semigroups-0.18.5: copy/register                                                asn1-parse-0.9.4: build                                                         asn1-parse-0.9.4: copy/register                                                 crypto-pubkey-types-0.4.3: download                                             crypto-pubkey-types-0.4.3: configure                                            reflection-2.1.4: copy/register                                                 socks-0.5.6: download                                                           crypto-pubkey-types-0.4.3: build                                                socks-0.5.6: configure                                                          socks-0.5.6: build                                                              split-0.2.3.3: download                                                         split-0.2.3.3: configure                                                        split-0.2.3.3: build                                                            split-0.2.3.3: copy/register                                                    stm-2.4.5.1: download                                                           stm-2.4.5.1: configure                                                          stm-2.4.5.1: build                                                              socks-0.5.6: copy/register                                                      stm-2.4.5.1: copy/register                                                      crypto-pubkey-types-0.4.3: copy/register                                        text-1.2.3.1: download                                                          text-1.2.3.1: configure                                                         StateVar-1.1.1.1: download                                                      text-1.2.3.1: build                                                             StateVar-1.1.1.1: configure                                                     th-abstraction-0.2.8.0: download                                                StateVar-1.1.1.1: build                                                         th-abstraction-0.2.8.0: configure                                               StateVar-1.1.1.1: copy/register                                                 th-abstraction-0.2.8.0: build                                                   time-locale-compat-0.1.1.5: download                                            time-locale-compat-0.1.1.5: configure                                           time-locale-compat-0.1.1.5: build                                               time-locale-compat-0.1.1.5: copy/register                                       transformers-compat-0.6.2: download                                             transformers-compat-0.6.2: configure                                            transformers-compat-0.6.2: build                                                th-abstraction-0.2.8.0: copy/register                                           microlens-th-0.4.2.3: download                                                  microlens-th-0.4.2.3: configure                                                 transformers-compat-0.6.2: copy/register                                        microlens-th-0.4.2.3: build                                                     contravariant-1.4.1: download                                                   contravariant-1.4.1: configure                                                  contravariant-1.4.1: build                                                      microlens-th-0.4.2.3: copy/register                                             exceptions-0.10.0: download                                                     exceptions-0.10.0: configure                                                    contravariant-1.4.1: copy/register                                              exceptions-0.10.0: build                                                        microlens-mtl-0.1.11.1: download                                                microlens-mtl-0.1.11.1: configure                                               microlens-mtl-0.1.11.1: build                                                   exceptions-0.10.0: copy/register                                                microlens-mtl-0.1.11.1: copy/register                                           optparse-applicative-0.14.3.0: download                                         optparse-applicative-0.14.3.0: configure                                        tagged-0.8.5: download                                                          optparse-applicative-0.14.3.0: build                                            tagged-0.8.5: configure                                                         tagged-0.8.5: build                                                             tagged-0.8.5: copy/register                                                     transformers-base-0.4.5.2: download                                             transformers-base-0.4.5.2: configure                                            transformers-base-0.4.5.2: build                                                transformers-base-0.4.5.2: copy/register                                        optparse-applicative-0.14.3.0: copy/register                                    unliftio-core-0.1.2.0: download                                                 unliftio-core-0.1.2.0: configure                                                unliftio-core-0.1.2.0: build                                                    vector-0.12.0.1: download                                                       unliftio-core-0.1.2.0: copy/register                                            vector-0.12.0.1: configure                                                     vector-0.12.0.1: build                                                          resourcet-1.2.2: download                                                       1
resourcet-1.2.2: configure                                                      
resourcet-1.2.2: build                                                          
resourcet-1.2.2: copy/register                                                  
void-0.7.2: download                                                            
void-0.7.2: configure                                                      
void-0.7.2: build                                                          
void-0.7.2: copy/register                                                  
zlib-0.6.2: download                                                       
zlib-0.6.2: configure                                                      
cryptonite-0.25: copy/register                                             
zlib-0.6.2: build                                                          
x509-1.7.4: download                                                       
x509-1.7.4: configure                                                 
x509-1.7.4: build                                                     
zlib-0.6.2: copy/register                                             
text-1.2.3.1: copy/register                                           
blaze-builder-0.4.1.0: download                                                 cookie-0.4.4: download                                                          cookie-0.4.4: configure                                                         blaze-builder-0.4.1.0: configure                                                cookie-0.4.4: build                                                             blaze-builder-0.4.1.0: build                                                    cookie-0.4.4: copy/register                                                     x509-1.7.4: copy/register                                                       hashable-1.2.7.0: download                                                      hashable-1.2.7.0: configure                                                     hashable-1.2.7.0: build                                                         mime-types-0.1.0.8: download                                                    mime-types-0.1.0.8: configure                                                   blaze-builder-0.4.1.0: copy/register                                            mime-types-0.1.0.8: build                                                       parsec-3.1.13.0: download                                                       parsec-3.1.13.0: configure                                                      hashable-1.2.7.0: copy/register                                                 parsec-3.1.13.0: build                                                          async-2.2.1: download                                                           async-2.2.1: configure                                                          async-2.2.1: build                                                              async-2.2.1: copy/register                                                      mime-types-0.1.0.8: copy/register                                               case-insensitive-1.2.0.11: download                                             case-insensitive-1.2.0.11: configure                                            psqueues-0.2.7.0: download                                                      case-insensitive-1.2.0.11: build                                                psqueues-0.2.7.0: configure                                                     psqueues-0.2.7.0: build                                                         case-insensitive-1.2.0.11: copy/register                                        parsec-3.1.13.0: copy/register                                                  http-types-0.12.2: download                                                     http-types-0.12.2: configure                                                    http-types-0.12.2: build                                                        Cabal-2.2.0.1: download                                                         Cabal-2.2.0.1: configure                                                        Cabal-2.2.0.1: build                                                            http-types-0.12.2: copy/register                                                psqueues-0.2.7.0: copy/register                                                 network-uri-2.6.1.0: download                                                   scientific-0.3.6.2: download                                                    network-uri-2.6.1.0: configure                                                  network-uri-2.6.1.0: build                                                      scientific-0.3.6.2: configure                                                   scientific-0.3.6.2: build                                                       network-uri-2.6.1.0: copy/register                                              scientific-0.3.6.2: copy/register                                               streaming-commons-0.2.1.0: download                                             streaming-commons-0.2.1.0: configure                                            streaming-commons-0.2.1.0: build                                                attoparsec-0.13.2.2: download                                                   attoparsec-0.13.2.2: configure                                                  attoparsec-0.13.2.2: build                                                      streaming-commons-0.2.1.0: copy/register                                        http-client-0.5.13.1: download                                                  http-client-0.5.13.1: configure                                                 http-client-0.5.13.1: build                                                     vector-0.12.0.1: copy/register                                                  unordered-containers-0.2.9.0: download                                          unordered-containers-0.2.9.0: configure                                         unordered-containers-0.2.9.0: build                                             http-client-0.5.13.1: copy/register                                             uuid-types-1.0.3: download                                                      uuid-types-1.0.3: configure                                                     uuid-types-1.0.3: build                                                         unordered-containers-0.2.9.0: copy/register                                     microlens-platform-0.3.10: download                                             microlens-platform-0.3.10: configure                                            uuid-types-1.0.3: copy/register                                                 microlens-platform-0.3.10: build                                                vector-algorithms-0.7.0.4: download                                             vector-algorithms-0.7.0.4: configure                                            vector-algorithms-0.7.0.4: build                                                attoparsec-0.13.2.2: copy/register                                              microlens-platform-0.3.10: copy/register                                        aeson-1.3.1.1: download                                                         x509-store-1.6.6: download                                                      x509-store-1.6.6: configure                                                     x509-store-1.6.6: build                                                         aeson-1.3.1.1: configure                                                        aeson-1.3.1.1: build                                                            x509-store-1.6.6: copy/register                                                 x509-system-1.6.6: download                                                     x509-system-1.6.6: configure                                                    x509-system-1.6.6: build                                                        x509-system-1.6.6: copy/register                                                x509-validation-1.6.10: download                                                x509-validation-1.6.10: configure                                               x509-validation-1.6.10: build                                                   x509-validation-1.6.10: copy/register                                           tls-1.4.1: download                                                             tls-1.4.1: configure                                                            tls-1.4.1: build                                                                vector-algorithms-0.7.0.4: copy/register                                        mono-traversable-1.0.9.0: download                                              mono-traversable-1.0.9.0: configure                                             mono-traversable-1.0.9.0: build                                                 tls-1.4.1: copy/register                                                        mono-traversable-1.0.9.0: copy/register                            
aeson-1.3.1.1: copy/register                            
Progress 86/111               

--  While building package Cabal-2.2.0.1 using:
      /Users/jonoabroad/.stack/setup-exe-cache/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY)
    Logs have been written to: /Users/jonoabroad/developer/addsharedo.com/my-haskell-lambda/.stack-work/logs/Cabal-2.2.0.1.log

    Configuring Cabal-2.2.0.1...
    Preprocessing library for Cabal-2.2.0.1..
    Building library for Cabal-2.2.0.1..
    [  1 of 221] Compiling Distribution.Compat.Binary ( Distribution/Compat/Binary.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Binary.o )
    [  2 of 221] Compiling Distribution.Compat.Directory ( Distribution/Compat/Directory.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Directory.o )
    [  3 of 221] Compiling Distribution.Compat.Exception ( Distribution/Compat/Exception.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Exception.o )
    [  4 of 221] Compiling Distribution.Compat.Internal.TempFile ( Distribution/Compat/Internal/TempFile.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Internal/TempFile.o )
    [  5 of 221] Compiling Distribution.Compat.Map.Strict ( Distribution/Compat/Map/Strict.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Map/Strict.o )
    [  6 of 221] Compiling Distribution.Compat.MonadFail ( Distribution/Compat/MonadFail.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/MonadFail.o )
    [  7 of 221] Compiling Distribution.Compat.Newtype ( Distribution/Compat/Newtype.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Newtype.o )
    [  8 of 221] Compiling Distribution.Compat.Semigroup ( Distribution/Compat/Semigroup.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Semigroup.o )
    [  9 of 221] Compiling Distribution.Compat.Stack ( Distribution/Compat/Stack.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Stack.o )
    [ 10 of 221] Compiling Distribution.Compat.Prelude ( Distribution/Compat/Prelude.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Prelude.o )
    [ 11 of 221] Compiling Distribution.Compat.SnocList ( Distribution/Compat/SnocList.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/SnocList.o )
    [ 12 of 221] Compiling Distribution.Compat.ReadP ( Distribution/Compat/ReadP.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/ReadP.o )
    [ 13 of 221] Compiling Distribution.Compat.Prelude.Internal ( Distribution/Compat/Prelude/Internal.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Prelude/Internal.o )
    [ 14 of 221] Compiling Distribution.Compat.Parsing ( Distribution/Compat/Parsing.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Parsing.o )
    [ 15 of 221] Compiling Distribution.Compat.Graph ( Distribution/Compat/Graph.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Graph.o )
    [ 16 of 221] Compiling Distribution.Compat.GetShortPathName ( Distribution/Compat/GetShortPathName.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/GetShortPathName.o )
    [ 17 of 221] Compiling Distribution.Compat.DList ( Distribution/Compat/DList.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/DList.o )
    [ 18 of 221] Compiling Distribution.Compat.Lens ( Distribution/Compat/Lens.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Lens.o )
    [ 19 of 221] Compiling Distribution.Compat.CopyFile ( Distribution/Compat/CopyFile.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/CopyFile.o )
    [ 20 of 221] Compiling Distribution.Compat.CharParsing ( Distribution/Compat/CharParsing.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/CharParsing.o )
    [ 21 of 221] Compiling Distribution.CabalSpecVersion ( Distribution/CabalSpecVersion.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/CabalSpecVersion.o )
    [ 22 of 221] Compiling Distribution.Compat.Environment ( Distribution/Compat/Environment.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/Environment.o )
    [ 23 of 221] Compiling Distribution.Compat.CreatePipe ( Distribution/Compat/CreatePipe.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Compat/CreatePipe.o )
    [ 24 of 221] Compiling Distribution.GetOpt ( Distribution/GetOpt.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/GetOpt.o )
    [ 25 of 221] Compiling Distribution.Lex ( Distribution/Lex.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Lex.o )
    [ 26 of 221] Compiling Distribution.PackageDescription.Quirks ( Distribution/PackageDescription/Quirks.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/PackageDescription/Quirks.o )
    [ 27 of 221] Compiling Distribution.PackageDescription.Utils ( Distribution/PackageDescription/Utils.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/PackageDescription/Utils.o )
    [ 28 of 221] Compiling Distribution.Parsec.Common ( Distribution/Parsec/Common.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/Common.o )
    [ 29 of 221] Compiling Distribution.Parsec.Field ( Distribution/Parsec/Field.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/Field.o )
    [ 30 of 221] Compiling Distribution.Parsec.LexerMonad ( Distribution/Parsec/LexerMonad.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/LexerMonad.o )
    [ 31 of 221] Compiling Distribution.Parsec.Lexer ( Distribution/Parsec/Lexer.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/Lexer.o )
    [ 32 of 221] Compiling Distribution.Parsec.Parser ( Distribution/Parsec/Parser.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/Parser.o )
    [ 33 of 221] Compiling Distribution.Pretty ( Distribution/Pretty.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Pretty.o )
    [ 34 of 221] Compiling Distribution.Simple.CCompiler ( Distribution/Simple/CCompiler.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Simple/CCompiler.o )
    [ 35 of 221] Compiling Distribution.Simple.PreProcess.Unlit ( Distribution/Simple/PreProcess/Unlit.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Simple/PreProcess/Unlit.o )
    [ 36 of 221] Compiling Distribution.Simple.Program.Internal ( Distribution/Simple/Program/Internal.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Simple/Program/Internal.o )
    [ 37 of 221] Compiling Distribution.TestSuite ( Distribution/TestSuite.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/TestSuite.o )
    [ 38 of 221] Compiling Distribution.Types.Condition ( Distribution/Types/Condition.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/Condition.o )
    [ 39 of 221] Compiling Distribution.Types.CondTree ( Distribution/Types/CondTree.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/CondTree.o )
    [ 40 of 221] Compiling Distribution.Utils.Base62 ( Distribution/Utils/Base62.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/Base62.o )
    [ 41 of 221] Compiling Distribution.Utils.IOData ( Distribution/Utils/IOData.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/IOData.o )
    [ 42 of 221] Compiling Distribution.Utils.MapAccum ( Distribution/Utils/MapAccum.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/MapAccum.o )
    [ 43 of 221] Compiling Distribution.Utils.Progress ( Distribution/Utils/Progress.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/Progress.o )
    [ 44 of 221] Compiling Distribution.Utils.String ( Distribution/Utils/String.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/String.o )
    [ 45 of 221] Compiling Distribution.Utils.ShortText ( Distribution/Utils/ShortText.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/ShortText.o )
    [ 46 of 221] Compiling Distribution.Utils.Generic ( Distribution/Utils/Generic.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Utils/Generic.o )
    [ 47 of 221] Compiling Distribution.Parsec.FieldLineStream ( Distribution/Parsec/FieldLineStream.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/FieldLineStream.o )
    [ 48 of 221] Compiling Distribution.Parsec.Class ( Distribution/Parsec/Class.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Parsec/Class.o )
    [ 49 of 221] Compiling Distribution.Text ( Distribution/Text.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Text.o )
    [ 50 of 221] Compiling Distribution.Types.Version ( Distribution/Types/Version.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/Version.o )
    [ 51 of 221] Compiling Distribution.Types.VersionRange ( Distribution/Types/VersionRange.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/VersionRange.o )
    [ 52 of 221] Compiling Distribution.Types.VersionInterval ( Distribution/Types/VersionInterval.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/VersionInterval.o )
    [ 53 of 221] Compiling Distribution.Types.SourceRepo ( Distribution/Types/SourceRepo.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/SourceRepo.o )
    [ 54 of 221] Compiling Distribution.Types.SourceRepo.Lens ( Distribution/Types/SourceRepo/Lens.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/SourceRepo/Lens.o )
    [ 55 of 221] Compiling Distribution.Types.PkgconfigName ( Distribution/Types/PkgconfigName.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/PkgconfigName.o )
    [ 56 of 221] Compiling Distribution.Types.ForeignLibType ( Distribution/Types/ForeignLibType.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/ForeignLibType.o )
    [ 57 of 221] Compiling Distribution.Types.ForeignLibOption ( Distribution/Types/ForeignLibOption.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/ForeignLibOption.o )
    [ 58 of 221] Compiling Distribution.Types.ExecutableScope ( Distribution/Types/ExecutableScope.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/ExecutableScope.o )
    [ 59 of 221] Compiling Distribution.Types.ComponentId ( Distribution/Types/ComponentId.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/ComponentId.o )
    [ 60 of 221] Compiling Distribution.Types.BuildType ( Distribution/Types/BuildType.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/BuildType.o )
    [ 61 of 221] Compiling Distribution.Types.AbiHash ( Distribution/Types/AbiHash.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/Types/AbiHash.o )
    [ 62 of 221] Compiling Distribution.System ( Distribution/System.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/System.o )
    [ 63 of 221] Compiling Distribution.SPDX.LicenseReference ( Distribution/SPDX/LicenseReference.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/SPDX/LicenseReference.o )
    [ 64 of 221] Compiling Distribution.SPDX.LicenseId ( Distribution/SPDX/LicenseId.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-2.2.0.1/build/Distribution/SPDX/LicenseId.o )
Received ExitFailure 1 when running
Raw command: /usr/local/bin/docker start -a -i c19f19b9e955134021e7a0cb61f7ae5144fb9cf5da474738a2b1fd00896b0900

make: *** [all] Error 1

Is type of `queryStringParameters` in API Gateway Request wrong?

apiGatewayRequestQueryStringParameters is defined as Maybe [(Text, Maybe Text)]. Other params are defined as Maybe (HashMap Text Text).

, apiGatewayRequestQueryStringParameters :: !(Maybe [(Text, Maybe Text)])
, apiGatewayRequestPathParameters :: !(Maybe (HashMap Text Text))
, apiGatewayRequestStageVariables :: !(Maybe (HashMap Text Text))

I'm currently seeing an error with an api gateway request trying to use query parameters:

"Error in $.queryStringParameters: parsing [] failed, expected Array, but encountered Object"

Query Params and e.g. path params seem to be encoded the same way as JSON objects. This is taken from the failure:

Query params

\"queryStringParameters\":{\"p1\":\"a\",\"p2\":\"b\"}

Path params

\"pathParameters\":{\"proxy\":\"test\"}

Complete failure

Parsing {errorMessage = "Error in $.queryStringParameters: parsing [] failed, expected Array, but encountered Object", actualValue = "{\"resource\":\"/{proxy+}\",\"path\":\"/test\",\"httpMethod\":\"POST\",\"headers\":{\"Accept\":\"*/*\",\"CloudFront-Forwarded-Proto\":\"https\",\"CloudFront-Is-Desktop-Viewer\":\"true\",\"CloudFront-Is-Mobile-Viewer\":\"false\",\"CloudFront-Is-SmartTV-Viewer\":\"false\",\"CloudFront-Is-Tablet-Viewer\":\"false\",\"CloudFront-Viewer-Country\":\"DE\",\"Host\":\"censored.execute-api.eu-central-1.amazonaws.com\",\"User-Agent\":\"curl/7.70.0\",\"Via\":\"2.0 2d469870f5a756385a1eb37325629a1f.cloudfront.net (CloudFront)\",\"X-Amz-Cf-Id\":\"M0uUf8tz1ay0UaVK2Evxy2-XKPR3FHLCAmQiKMPComtwpHdB6Fq48A==\",\"X-Amzn-Trace-Id\":\"Root=1-5f1611af-24cc28a6b79825eec469b128\",\"X-Forwarded-For\":\"188.193.101.224, 54.239.135.134\",\"X-Forwarded-Port\":\"443\",\"X-Forwarded-Proto\":\"https\"},\"multiValueHeaders\":{\"Accept\":[\"*/*\"],\"CloudFront-Forwarded-Proto\":[\"https\"],\"CloudFront-Is-Desktop-Viewer\":[\"true\"],\"CloudFront-Is-Mobile-Viewer\":[\"false\"],\"CloudFront-Is-SmartTV-Viewer\":[\"false\"],\"CloudFront-Is-Tablet-Viewer\":[\"false\"],\"CloudFront-Viewer-Country\":[\"DE\"],\"Host\":[\"censored.execute-api.eu-central-1.amazonaws.com\"],\"User-Agent\":[\"curl/7.70.0\"],\"Via\":[\"2.0 2d469870f5a756385a1eb37325629a1f.cloudfront.net (CloudFront)\"],\"X-Amz-Cf-Id\":[\"M0uUf8tz1ay0UaVK2Evxy2-XKPR3FHLCAmQiKMPComtwpHdB6Fq48A==\"],\"X-Amzn-Trace-Id\":[\"Root=1-5f1611af-24cc28a6b79825eec469b128\"],\"X-Forwarded-For\":[\"188.193.101.224, 54.239.135.134\"],\"X-Forwarded-Port\":[\"443\"],\"X-Forwarded-Proto\":[\"https\"]},\"queryStringParameters\":{\"p1\":\"a\",\"p2\":\"b\"},\"multiValueQueryStringParameters\":{\"p1\":[\"a\"],\"p2\":[\"b\"]},\"pathParameters\":{\"proxy\":\"test\"},\"stageVariables\":{\"stage\":\"development\"},\"requestContext\":{\"resourceId\":\"r236sb\",\"resourcePath\":\"/{proxy+}\",\"httpMethod\":\"POST\",\"extendedRequestId\":\"P_ezeFsqFiAFpdA=\"* Connection #0 to host censored.execute-api.eu-central-1.amazonaws.com left intact
,\"requestTime\":\"20/Jul/2020:21:50:39 +0000\",\"path\":\"/cestStage108C25QZEY860/test\",\"accountId\":\"censored\",\"protocol\":\"HTTP/1.1\",\"stage\":\"cestStage108C25QZEY860\",\"domainPrefix\":\"censored\",\"requestTimeEpoch\":1595281839755,\"requestId\":\"92709229-beca-480e-986f-22158bcb3ff1\",\"identity\":{\"cognitoIdentityPoolId\":null,\"accountId\":null,\"cognitoIdentityId\":null,\"caller\":null,\"sourceIp\":\"188.193.101.224\",\"principalOrgId\":null,\"accessKey\":null,\"cognitoAuthenticationType\":null,\"cognitoAuthenticationProvider\":null,\"userArn\":null,\"userAgent\":\"curl/7.70.0\",\"user\":null},\"domainName\":\"censored.execute-api.eu-central-1.amazonaws.com\",\"apiId\":\"censored\"},\"body\":null,\"isBase64Encoded\":false}", valueName = "ApiGatewayRequest Text"}

The amazon docs example list them as objects, too.

image

So could the type definition Maybe [(Text, Maybe Text)] be wrong and the cause for this failure? If this can be reproduced on your side (because I'm not 100% sure), then a change to HashMap would be an awesome fix :)

bootstrap errors not logging

I'm doing something where the payload can't decode to my handler input type, I used to get an error in cloudwatch logs when this happened but I upgraded from version 2.0.4 to 3.0.0 and this log has disappeared.

The project contains no local packages (packages not marked with 'extra-dep')

Hello, I've encountered an error after following the medium post (https://medium.com/the-theam-journey/getting-started-with-the-haskell-aws-lambda-runtime-951b2322c7a3)

Series of commands I ran:

stack new my-haskell-lambda https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-12.13 --omit-packages
cd my-haskell-lambda
stack docker pull
make

Error from running make:

Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Error parsing targets: The project contains no local packages (packages not marked with 'extra-dep')
Received ExitFailure 1 when running
Raw command: /usr/bin/docker start -a -i 18eebd72f8de64efa8d443bb768d1f1e70b4ab42f85e080b3fe0c989978c2b32

Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

Non-JSON payloads

We are trying to deploy a SAM app to respond to Slack slash-commands. When you deploy a AWS::Serverless::Function with an Api event source, you get an API Gateway with a proxy lambda — so HTTP POST requests are relayed verbatim to the Lambda under apiGatewayRequestBody. Slack posts parameters as application/x-www-form-urlencoded, but ApiGatewayRequest's FromJSON instance requires the body to be JSON-formatted.

This all means that there is no (simple) way to use aws-lambda-haskell-runtime with AWS SAM to receive the Slack payload. I've forked this repository to add the functionality I need, but I am not convinced my solution will work for everyone so I'm not willing to submit a PR yet.

Linking error

Hi all,

After following the tutorial: https://theam.github.io/aws-lambda-haskell-runtime/06-deploying-a-lambda.html

I ended with a lambda function I have configured with the Custom runtime.

When I try to make a test call, I have got this error:

START RequestId: 29389b30-aff6-46be-9e9c-f8e3fa859bf3 Version: $LATEST
/var/task/bootstrap: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /var/task/bootstrap)
END RequestId: 29389b30-aff6-46be-9e9c-f8e3fa859bf3
REPORT RequestId: 29389b30-aff6-46be-9e9c-f8e3fa859bf3	Duration: 35.17 ms	Billed Duration: 100 ms	Memory Size: 128 MB	Max Memory Used: 6 MB	
RequestId: 29389b30-aff6-46be-9e9c-f8e3fa859bf3 Error: Runtime exited with error: exit status 1
Runtime.ExitError

I use stack with the lts-16.8.

Have you got any insight regarding that ?

Thanks by advance.

Fix continuous deployment

Currently the deployment of the layer errors with:

An error occurred (UnrecognizedClientException) when calling the PublishLayerVersion operation: The security token included in the request is invalid.

We have to fix this, also we should auto-publishing to Hackage

Example main code in docs out of date

On https://theam.github.io/aws-lambda-haskell-runtime/03-configuring-the-dispatcher.html
we get a main that looks like this

main :: IO ()
main = do
  handlerName <- getHandlerName
  context <- getContext
  input <- getInput
  case handlerName of
    "src/Lib.handler" -> do
      result <- Lib.handler input context
      publish result

but this seems very different from what’s generated by https://hackage.haskell.org/package/aws-lambda-haskell-runtime-2.0.3/docs/src/Aws.Lambda.Meta.Main.html#generate. Are the docs out of date?

(I probably shouldn’t mess with such low level things, but I like to understand the tools that I am using, and avoiding TH is part of that.)

Handler src/Lib.handler does not exist on project

Hey. I tried following the docs with the person example and I'm getting the following error when trying to test it on AWS.

"Handler src/Lib.handler does not exist on project"

When I try seeing the TH generated code from Main.hs I only see the default case

    main = do runLambda run
    run
      LambdaOptions {functionHandler = functionHandler,
                     contextObject = contextObject, eventObject = eventObject,
                     executionUuid = executionUuid}
      = case functionHandler of {
          _ -> (pure
                  $ Left
                      ("Handler "
                         <> (functionHandler <> " does not exist on project"))) }

My app/Main.hs looks like this:

module Main where

import Aws.Lambda

import qualified Lib

generateLambdaDispatcher

src/Lib.hs:

{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric  #-}

module Lib where

import qualified Aws.Lambda   as Lambda
import qualified Data.Aeson   as Aeson
import qualified GHC.Generics as Generics

data Person
  = Person
      { personName :: String
      , personAge  :: Int
      }
  deriving (Generics.Generic, Aeson.FromJSON, Aeson.ToJSON)

handler
  :: Person
  -> Lambda.Context
  -> IO (Either String Person)

handler person _context
  = if personAge person > 0
    then pure $ Right person
    else pure $ Left "A person's age must be positive"

Is there a bug or am I doing something wrong?

layer

I get an error adding the layer arn:aws:lambda:us-east-1:785355572843:layer:haskell-runtime:2

You are not authorized to perform: lambda:GetLayerVersion.

(might be a pb with my config, but it says

If you would like to use a layer published in another account, you need to ensure the layer publisher has set the correct permissions on the layer version to make it available in your account.

)

Runtime timeout errors

I have lambda function deployed and experiencing some runtime errors. This happens pretty often on first invocation. Once it happens it's hard to replicate with consecutive invocations without waiting for a minute.

{
  "errorType": "Runtime.ExitError",
  "errorMessage": "RequestId: d922d798-3cc4-4a04-a492-acf5a3d69dc5 Error: Runtime exited with error: exit status 1"
}
START RequestId: d922d798-3cc4-4a04-a492-acf5a3d69dc5 Version: $LATEST
bootstrap: HttpExceptionRequest Request {
  host                 = "127.0.0.1"
  port                 = 9001
  secure               = False
  requestHeaders       = [("User-Agent","haskell wreq-0.5.2.1")]
  path                 = "/2018-06-01/runtime/invocation/next"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ResponseTimeout
END RequestId: d922d798-3cc4-4a04-a492-acf5a3d69dc5
REPORT RequestId: d922d798-3cc4-4a04-a492-acf5a3d69dc5	Duration: 51.78 ms	Billed Duration: 100 ms 	Memory Size: 512 MB	Max Memory Used: 57 MB	
RequestId: d922d798-3cc4-4a04-a492-acf5a3d69dc5 Error: Runtime exited with error: exit status 1
Runtime.ExitError

EDIT
aws-lambda-haskell-runtime-1.0.9
Lambda layer v2

EDIT
Also tested clean installation as per instructions in repo and experiencing the same issue.

Sometimes a function goes into a stall

I'm trying to deploy a lambda function written in Haskell, and find that some of deployments fail by timeout, though the source code files are exactly same.

When a function fails, then re-invocation nor re-deploy doesn't matter. That is, you have to (at least) build the binary again. But I've not found the minimal condition when and why the trouble rises.

Sorry for the lack of a procedure for reproducing. Do you have any idea?

Environment

  • built in fpco/stack-build:lts-12.13 by stack build --docker
  • stack clean --full --docker everytime
  • aws-lambda-haskell-runtime-1.0.7
  • arn:aws:lambda:ap-northeast-1:785355572843:layer:aws-haskell-runtime:2

Source

src/HelloWorld.hs

{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}

module HelloWorld where

import           Aws.Lambda.Runtime   (Context)
import           Data.Aeson           (ToJSON, encode)
import qualified Data.ByteString.Lazy as BS
import           Data.Default.Class   (def)
import qualified Data.Text            as T
import qualified Data.Text.Encoding   as T
import           GHC.Generics         (Generic)
import           Network.HTTP.Req

handler :: () -> Context -> IO (Either String APIGatewayProxyResponse)
handler _ _ = do
    bs <- runReq def $ do
        req GET (https "checkip.amazonaws.com") NoReqBody bsResponse mempty
    let ip = T.init $ T.decodeUtf8 $ responseBody bs
        res = Response "hello world" ip
        pres = APIGatewayProxyResponse 200
                (T.decodeUtf8 $ BS.toStrict $ encode res)
    return $ Right pres

data Response = Response {
      message  :: T.Text
    , location :: T.Text
    } deriving (Generic)

instance ToJSON Response

-- to integrate with API Gateway, the response body should be string-ified.
data APIGatewayProxyResponse = APIGatewayProxyResponse {
      statusCode :: Int
    , body       :: T.Text
    } deriving (Generic)

instance ToJSON APIGatewayProxyResponse

app/Main.hs

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell   #-}

module Main where

import           Aws.Lambda.Configuration
import           Aws.Lambda.Runtime

import qualified HelloWorld

configureLambda

Response

succeeded case:

{ "statusCode": 200, "body": "{ \"location\", \"198.51.100.123\", \"message\": \"hello world\" }" }

failed case:

{ "errorMessage":"2019-01-17T07:43:58.370Z 51ba6bb5-5ca1-4e7d-96b3-6e54490dd39a Task timed out after 20.02 seconds" }

Don't read context environment variables on every call

If we look at the initialize function here and then how it's used here we can see that there are 5 environment variables that are being read on every call.

This can be done on cold start only, as none of these variables will change without the lambda being refreshed. (I'm not totally sure about logStream and logGroup)

Couldn't find valid bootstrap(s)

I've created a lambda using layer v7 in us-east-1, and I'm getting this error when running a test event against it:

{
  "errorType": "Runtime.ExitError",
  "errorMessage": "RequestId: 69b1919f-0971-11e9-bfd5-23465fb3fa95 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]"
}

My Lib.hs is pretty simple:

module Lib where

import Aws.Lambda.Runtime
import Data.Aeson

handler :: Value -> Context -> IO (Either String Value)
handler v _ = return (Right v)

Any help with what I might be doing wrong is appreciated. Thanks in advance!

Native support for API Gateway

As exposing your Lambda through API Gateway is a very common approach, do you think it would make sense to add "native" support for it inside the runtime?

I'm thinking something like this:

generateLambdaDispatcher UseWithAPIGateway.

Passing UseWithAPIGateway will automatically adjust the plumbing underneath so it knows how to parse the incoming event and send back a well-formed response.

Then the handlers could look something like

-- This type will be provided by the runtime
data APIGatewayEvent e =
  APIGatewayEvent
    { resource :: String
    .....
    , body :: e }
    
handler :: APIGatewayEvent SomeValue -> Context -> IO (Either Error Response)
handler ...

I could submit a PR if you're interested.

Testing locally with AWS SAM

OS: Debian
Stack: 2.5.1
GHC: 8.8.3

I've been trying to invoke the standard template's Handler (src/Lib.hs) locally to test, using
sam local invoke -e query.json

where query.json simply contains:
{"personName": "value1", "personAge": 22}

Till now, I've created a /template.yaml file which reads:

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
  Lambda handlers f
Resources:
  svelteHaskell:
    Type: AWS::Serverless::Function
    Properties:
      Handler: handler
      Runtime: provided
      CodeUri: 'build/function.zip'
      Description: >
          Main Handler 

In place of handler I have tried various combinations which include:

  • 'src/Lib.hs'
  • provided
    -Lib

All of which gives the same error on sam invoke: "Handler handler does not exist on project"
Is there a proper way I should be testing this locally?

Clarification in docs w.r.t setting headers in response

While screwing around with the library, I got the clever idea to try returning html directly from an aws function rather than JSON. In node this is easy to do by just setting the response header ContentType to html.

However, this runtime seems to require that ToJSON be implemented for the response type, but as far as I can see, the headers are supposed to be of type [(HeaderName, ByteString)] as specified in the documentation. Of course, bytestring has no ToJSON instance (neither does HeaderName) so GHC rightfully throws a fit.

Is there something I'm missing regarding setting headers for the response? Or with the (albeit unusual) usecase of spitting out HTML directly from a function?

`Servant` & `beam`: ``gcc' failed in phase `Linker'`

Check out the branches persistent and beam: https://github.com/Jimbo4350/serverless-servant-faulty

If you remove comment out: fromServant <- makeHandler (serve itemApi server) event & ++ ByteString.unpack fromServant in src/Lib.hs the package will compile. Otherwise it fails with a linking error.

handler :: Event -> Context -> IO (Either String Response)
handler event context = do
  fromServant <- makeHandler (serve itemApi server) event
  pure $ Right Response
    { statusCode = 200
    , body = "test: " ++ ByteString.unpack fromServant
    }

AWS complains "Handler bootstrap does not exist on project"

Hope not too dumb a question...

I've made the bootstrap (via docker method) and then function.zip from that.

I could run ./bootstrap locally which wanted the env variable AWS_LAMBDA_RUNTIME_API set.

I've manually loaded the function.zip and set the runtime to 'custom runtime' and then tried several permutations for 'handler'. But I get the error -

"Handler bootstrap does not exist on project"

Can you point me in the right direction please?

[Question] Fetching values from SSM from Haskell Lambda

Hi,

we are trying to retrieve a value from SSM within a Haskell Lambda (aws-lambda-haskell-runtime).
If we were writing this lambda using JavaScript we would do something like this:

(...)
const AWS = require('aws-sdk');
const SSM = new AWS.SSM({
  httpOptions: {
    connectTimeout: parseInt(process.env.CONNECT_TIMEOUT),
    timeout: parseInt(process.env.REQUEST_TIMEOUT),
  },
});
const response = await SSM.getParameter({
      Name: name,
      WithDecryption: true,
 }).promise();
(....)

Is there an equivalent call that we could run on the aws-lambda-haskell-runtime?

No authorizer field in the ApiGatewayRequestContext data type

Hello!

According to the docs there is an authorizer field that is not currently in the ApiGatewayRequestContext data type.

Is there a reason for this field not being present? If not, then I'd be happy to submit a PR where this field is present in the data type.

Allow to store some state between invocations

Are there any plans to allow to store some state in between handler invocations?
Like HTTP connections, DB connections and so on?

If not, feel free to close this issue.

At first I thought of adding this ad-hoc using the most quick-and-dirty method I could think of which was dumping the generateLambdaDispatcher output manually, cleaning it up a bit and adding around it the necessary code. However it seems like the required modules are not exported outside of the library (which is understandable).
I could take this further and clone the library exporting what is needed, but I'd like to ask whether or not adding this support is on the menu? Or perhaps why this approach is not a good idea and I should try something else?

Looking at https://medium.com/the-theam-journey/benchmarking-aws-lambda-runtimes-in-2019-part-ii-50e796d3d11b I was curious whether or not having state between invocations could improve Haskell's execution and bring it a little bit closer to the other languages in the benchmark. Perhaps you've already benchmarked this but saw no interesting difference?

Any help is greatly appreciated!

Question about external libraries, e.g libpq.so.5

I hit a snag with external libraries, much like the ones mentioned here.

I got round them, at least initially, with doing a ldd bootstrap in the ./build folder, and then copying the ones I needed into ./lib, and then adding this to the Makefile.

rsync -rl ./lib/ ./build/lib/
cd build && zip -r quotation-lambda.zip bootstrap lib && cd ..

$LAMBDA_TASK_ROOT/lib seemed to already be in the LD_LIBRARY_PATH, so I just went for that.

This got a bit tedious, and I've found a way of copying everything into the ./lib folder using ldd + sed, but I also tried to add this in my package.yaml, and that seemed to do the job with less ceremony:

ghc-options:
-threaded
-rtsopts
-O2
-static
-with-rtsopts=-N
cc-options: -static
ld-options: -static -pthread

Are there reasons for not statically linking the executable when building with stack?

Error following the "Getting started" documentation: The project contains no local packages

I am trying to create my first project as follows:

  1. I run stack new <my_project> https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-15.16 --omit-packages
  2. I add aws-lambda-haskell-runtime-3.0.0 in extra-deps section of stack.yaml file
  3. I run stack build

The output is the following error message:

> stack build
Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Error parsing targets: The project contains no local packages (packages not marked with 'extra-dep')

As a Haskell newbie, I tried to add the following snippet in stack.yaml file:

packages:
  - .

I have no idea of what I did but now the stack build command seems to be proceeding. In the end, it produced the following message:

<path_to_my_project>/<my_project>.cabal was modified manually. Ignoring <path_to_my_project>/<my_project>/package.yaml in favor of the cabal file.
If you want to use the package.yaml file instead of the cabal file,
then please delete the cabal file.

I removed the cabal file and it worked smoothly.

I use Stack 2.3.3, Cabal 1.24.0.2 and Glasgow Haskell 8.0.2.

Getting error when following instructions in docs

I followed the instructions in the docs which said:

If you currently have a project, you can add this package by adding,
to the stack.yaml file: extra-deps: - aws-lambda-haskell-runtime-2.0.0

I get the following error on stack build:

image

I can resolve it by using aws-lambda-haskell-runtime-2.0.1. in the extra-deps but it would be nice if the docs were correct. Especially to not scare of beginners. I think Haskell lambdas would be a great and low-risk entry point for many trying to get Haskell into production.

Example fails to build on macOS Mojave

Hi,

I'm following the guide on Medium, but after pulling the Docker image make fails to complete with this error:

$ make
Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

random-1.1: configure
... (some stuff)
text-1.2.3.1: copy/register
Progress 9/75
Received ExitFailure 1 when running
Raw command: /opt/ghc/8.4.3/bin/ghc-pkg --user --no-user-package-db --package-db /Users/mikifossati/.stack/snapshots/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/lts-12.13/8.4.3/pkgdb describe --simple-output text --expand-pkgroot
Standard error:

ghc-pkg: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)


Received ExitFailure 1 when running
Raw command: /opt/ghc/8.4.3/bin/ghc-pkg --user --no-user-package-db --package-db /Users/mikifossati/.stack/snapshots/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/lts-12.13/8.4.3/pkgdb describe --simple-output th-abstraction --expand-pkgroot
Standard error:

ghc-pkg: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)

Received ExitFailure 1 when running
Raw command: /usr/local/bin/docker start -a -i df8a50e7914c42830b499f6c7158d9087d9b2b531d40c9adc9e482b1563e38fc

make: *** [all] Error 1

Any suggestion? In case I'm happy to help.

Thank you,

(M)

Native support for Application Load Balancer

AWS ALB has Lambda integration now however the events it sends are slightly different to the APIGW Lambda Proxy events and UseWithAPIGateway can't cope with these differences it seems. It would be great to have either UseWithALB or even better something that allowed use with both. I couldn't find any official documentation with explicit differences however this blog post outlines them https://serverless-training.com/articles/api-gateway-vs-application-load-balancer-technical-details/#feature-differences-between-application-load-balancer-and-api-gateway

Issue when using UseWithAPIGateway and OverloadedStrings as a default extension

If you have OverloadedStrings enabled (e.g. as a default) and attempt to use UseWithAPIGateway, you'll get a similar error.

Ambiguous type variable ‘a0’ arising from a use of ‘aeson-1.4.7.1:Data.Aeson.Types.ToJSON.toJSON’       prevents the constraint ‘(aeson-1.4.7.1:Data.Aeson.Types.ToJSON.ToJSON                                   a0)’ from being solved.

The fix is to just add {-# LANGUAGE NoOverloadedStrings #-} at the top of the file.

This issue can be easily resolved by annotating the strings in the generated code.

Sample lambda function instructions fail on NixOS

I assume this is something to do with the interaction between stack and docker, as I have tested on OSX and it is fine, and the code builds using cabal, but of course, doesn't run once deployed to AWS.

I am not familiar enough with stack, nor how it interacts with docker to understand what is going on.

Any help would be wonderful .

$ nixos-version 
18.09.2327.37694c8cc0e (Jellyfish)
$ stack --version
1.9.3 x86_64 hpack-0.31.1
$     ghc --version 
The Glorious Glasgow Haskell Compilation System, version 8.4.4
$ docker --version
Docker version 18.09.2, build 62479626f213818ba5b4565105a05277308587d5
$ make
Received ExitFailure 1 when running
Raw command: /run/current-system/sw/bin/docker run -v /nix/store/wwsbwrrqs47sac1g2g8ny3g68m7mjlrm-stack-1.9.3/bin/stack:/tmp/stack sha256:8b7fe581dc0148347fae4c883eba74e338bdf1b94df73f0db0c68201d129a454 /tmp/stack --version

make: *** [Makefile:4: all] Error 1
$ stack clean --docker 
Received ExitFailure 1 when running
Raw command: /run/current-system/sw/bin/docker run -v /nix/store/wwsbwrrqs47sac1g2g8ny3g68m7mjlrm-stack-1.9.3/bin/stack:/tmp/stack sha256:8b7fe581dc0148347fae4c883eba74e338bdf1b94df73f0db0c68201d129a454 /tmp/stack --version

You are not authorized to perform: lambda:GetLayerVersion

UPDATE: I tried this from US-East-1: it worked. I originally tried Canada-Central: it didn't work. This is a region issue, not a layer permissions issue.

I get this error in the Lambda console:

You are not authorized to perform: lambda:GetLayerVersion

The logs have this error:

{
  "errorType": "Runtime.ExitError",
  "errorMessage": "RequestId: d845feca-fceb-11e8-a5cd-8561bb36db60 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]"
}

I think the layer needs a resource policy to allow other accounts to pull it.

I may be wrong. I may just have a silly IAM policy.

I've tried adding lambda:GetLayerVersion on arn:aws:lambda:us-east-1:785355572843:layer:haskell-runtime:2 and even lambda:* on *.

The Layer arn:aws:lambda:us-east-1:785355572843:layer:haskell-runtime:2 does not appear to be accessible to other accounts.

I think this might fix it:

aws lambda add-layer-version-permission --layer-name haskell-runtime \
--statement-id allow-everyone --version-number 2 --principal '*' \
--action lambda:GetLayerVersion

That's based on a doc on Layer Permissions here:
https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-permissions

Build fail on official Stack template

After doing stack build on the official template from the docs

stack new my-haskell-lambda https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-13.25 --omit-packages

build fails with the following error:

app\Main.hs:7:1: error:
    Illegal variable name: `'
    When splicing a TH declaration:
      run (LambdaOptions {functionHandler = functionHandler,
                    contextObject = contextObject,
                    eventObject = eventObject,
                    executionUuid = executionUuid}) = case functionHandler of
                                                          "src\\Lib.handler" -> do {result_0 <- () (Aws.Lambda.Meta.Dispatch.decodeObj eventObject) (Aws.Lambda.Meta.Dispatch.decodeObj contextObject);
                                                                                    Data.Either.either (GHC.Base.pure GHC.Base.. (Data.Either.Left GHC.Base.. Aws.Lambda.Meta.Dispatch.encodeObj)) (GHC.Base.pure GHC.Base.. (Data.Either.Right GHC.Base.. (LambdaResult GHC.Base.. Aws.Lambda.Meta.Dispatch.encodeObj))) result_0}
                                                          _ -> GHC.Base.pure GHC.Base.$ Data.Either.Left ("Handler " GHC.Base.<> (functionHandler GHC.Base.<> " does not exist on project"))
  |
7 | generateLambdaDispatcher
  | ^^^^^^^^^^^^^^^^^^^^^^^^


--  While building package my-haskell-lambda-0.1.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.5.exe --builddir=.stack-work\dist\e626a42b build lib:my-haskell-lambda exe:bootstrap --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

I am relatively new to Haskell, so not sure whether this is a problem with my environment or this project.

OS: Windows 10
Stack: 2.1.3

Unable to find Libpcre in runtime environment

I get this error when trying to run my Lambda:

/var/task/bootstrap: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory

I am not sure what is requiring this dependency when everything is compiled down. Everything builds find in the stack docker image

My haskell dependencies look like this:

dependencies:
  - aeson
  - aws-lambda-haskell-runtime >= 2.0.0
  - base >= 4.7 && < 5
  - bson
  - containers
  - http-conduit
  - monad-logger
  - mtl
  - mongoDB
  - persistent
  - persistent-mysql
  - persistent-template
  - text
  - time

I don't think any of this is too out of the normal. I was having some issues with OpenSSL and persistent-mysql on my machine that required me to install with these flags enabled in my stack.yaml:

extra-include-dirs: [/usr/local/opt/openssl/include]
extra-lib-dirs: [/usr/local/opt/openssl/lib]

but everything seemed to compile using stack build --docker.

Any ideas what is causing this? I imagine it is something to do with not having access to the Libpcre library in the runtime, but I don't know what is causing my project to depend on that library.

If you need more information let me know. Thanks.

Research memory/CPU usage

According to #18 the runtime chokes on values less than 512MB of RAM.

It would be very nice (and necessary) to know what can be optimized to allow less values of RAM.

Code generation with generateLambdaDispatcher leads to warnings (Update: Addressed by upcoming 4.0.0)

With

generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions

I'm currently seeing these warnings:

/app/Main.hs:58:1: warning: [-Wunused-matches]
    Defined but not used: ‘executionUuid’
   |
58 | generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/app/Main.hs:58:1: warning: [-Wunused-matches]
    Defined but not used: ‘eventObject’
   |
58 | generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/app/Main.hs:58:1: warning: [-Wunused-matches]
    Defined but not used: ‘contextObject’
   |
58 | generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/app/Main.hs:58:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature:
      run :: Applicative f =>
             LambdaOptions context
             -> f (Either
                     aws-lambda-haskell-runtime-3.0.1:Aws.Lambda.Runtime.Common.LambdaError
                     b)
   |
58 | generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/app/Main.hs:58:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: main :: IO ()
   |
58 | generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Is it possible to get rid of them?

Version 3.0.1

Question: How do I log from a Lambda

How can I output logs from my handler?

I have been able to create a Lambda using the runtime, and I can return responses that indicate that my handler is being called correctly.

In order to make it easier to develop and debug, I would like to be able to output logs into the CloudWatch logs for the Lambda. If I just do a putStrLn the output is not logged into the CloudWatch log group for the Lambda.

Separate binaries for multiple functions

In my understanding, the current implementation of configureLambda does:

  • Traverse directories regardless of dependencies
  • Find all functions named handler then splices them as <MODULEPATH>.handler

As a result, all of handlers are packed the single Main.hs and thus the single binary haskell_lambda.

On the other hand, generally speaking, an application consists of multiple Lambda functions, e.g. create-user, get-user, delete-user and so on. Since such functions have common logic it is good to put them into a single repository.

For multi-function applications, the "single binary" setting looks not so good because all of functions contain all of dependencies. I'm afraid that it increases the size of function.zip, and hinders differential build per functions.

Do you have some best practices or plan to do that?

Managing context between invocations

Hi, congrats for this great project!

I do not know much about custom runtimes, sorry if this is a newbie question!

I was wondering how you manage the AWS Lambda Execution Context.

In Nodejs background processes (e.g. http, timeouts) that did not complete when the function returned are resumed in hot starts. How does it work with this runtime?

Thanks!

Open questions in Docs

I have a couple of open questions that aren't answered in the docs (https://theam.github.io/aws-lambda-haskell-runtime/index.html) or anywhere else I could find. I think it would be good to mention that as well some in the docs.

  1. The docs say this

Well, the reality is that Haskell didn’t work as well as the supported languages did. We had to apply ugly hacks to make it work, and we ended up switching to TypeScript or other better supported languages for production projects. But that’s all in the past!
Why didn't it fit well before? What changed so that those hacks were no longer needed?

  1. How to do deployment/ do I need a layer? Some time ago there used to be a medium article with some deployment instruction but I am not sure of that is no longer valid with version 2 of this runtime. What changed in version 2?

  2. What's the reason for Haskell being slower than node.js? Seems like a compiled language should be faster. Maybe this is hard to answer without some serious benchmarking.

Thanks for making the runtime.

Way to return an error as json

Current only a String can be returned on the left, this would be fine except it goes via toJSON so if you already have json then it's double encoded.

If it there was a way to pass the string through untouched (not going via toJSON) as with LambdaResult that would be great.

Why String?

There's a lot of usage of "strict" Strings in the package. Is there a good reason not to use Text? Particularly since there's a dependency on Aeson (and probably others), Text is already an indirect dependency. using !String just forces the list constructor, and leaves the tail of the list unevaluated (and also causes an under the hood conversion from Text to String within Aeson).

bootstrap: c_poll: permission denied (Operation not permitted)

First of all I want to thank authors for the runtime and doc-site: great job, thank you!

I've deployed runtime https://github.com/Unisay/haskell-aws-lambda-template and able to successfully invoke my function (Yay!) but
I am worried about the following error message in the logs:

bootstrap: c_poll: permission denied (Operation not permitted)

sls invoke -f haskell-aws-lambda -l -d '{ "personName": "Chuck Norris", "personAge": 79 }'                               2533ms  Fri 23 Aug 17:51:52 2019
{
    "personAge": 79,
    "personName": "Chuck Norris"
}
--------------------------------------------------------------------
START RequestId: 5c64dd18-ef19-43a9-b241-1e1047bdc290 Version: $LATEST
bootstrap: c_poll: permission denied (Operation not permitted)
END RequestId: 5c64dd18-ef19-43a9-b241-1e1047bdc290
REPORT RequestId: 5c64dd18-ef19-43a9-b241-1e1047bdc290  Init Duration: 58.85 ms Duration: 28.64 ms      Billed Duration: 100 ms         Memory Size: 1024 MB    Max Memory Used: 47 MB

Do you have an idea of what causes it, and what are the consequences?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.