Thank you for reading. Great question!

Lambda functions run inside what AWS calls "execution environments". These environments provide you with a "/tmp" directory that you can use for temporary file storage or caching. Remember though the data stored here gets wiped off if the function remains inactive for some time.

See the official documentation for details:

https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html (Look under "Shutdown phase")

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store