Lambda compliant compilation of node modules

Some node libraries have to be compiled with a lambda compliant linux.

For example, I use crypto and I have to create an EC2 with an Amazon Linux AMI to build the module before I send it to lambda.

Does Serverless handle such a situation ?
I believe send to lambda node modules compiled on my dev machine is really not a good practice.

Not really answering your question, but I simply changed to pure javascript bcryp library. Using native libs is pain in the ass.

Thanks for your answer.

if you’re talking about bcrypt.js I have tested it and it is very very slow.

Anyway, the issue will exist with other libraries :frowning:

No, Serverless does not compile native libs for you - it’s polyglot by default, so supporting all the various runtimes’ compilations is non-trivial.

AWS just released an official AWS Linux container to help address use-cases like yours; With it you can compile native libraries consistently without using a development machine.

1 Like

ho great news I did not know, thank you :wink: