aws-lambda

How to keep state in AWS lambdas?


We have a library that gives us access to some external API, but it has a very long initialisation time. Also there is no way to initialize it with some session key or anything that could be stored, it always has to go through the whole initialisation process.

Is there a way to have the library initialized only once and then used across all lambda functions?

If we were somehow able to inject the session by reverse engineering the code, where would the session data be stored best? In DynamoDB, stage variables, something else?


Solution