2 Answers
- Newest
- Most votes
- Most comments
0
Hello,
According to AWS documentation, it's not possible to create a new instance with a fresh environment each time, since after the function and all extensions have completed, Lambda freezes the execution environment for some time in anticipation of another function invocation.
It doesn't always happen, so do not assume that Lambda automatically reuses the execution environment for all subsequent function invocations, but it is the default/expected behaviour.
0
Lambda was designed to reuse the execution environment between invocations to save on cold starts. Why do you need to create a new one for each invocation?
Relevant content
- Accepted Answerasked 2 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago