Inside a certain function I want to stop the whole Lambda process but not trigger an error. I've tried looking at the context variable to stop it or just calling exit()
but each time it's treated as an error which I don't want to track.
How can I end successfully a Lambda process in Python?
In AWS Lambda you define a handler
function and in Python a function just needs to return
in order to complete successfully, where return
implies return None
.
What you've done is correct, just have multiple return points in that handler function. You can always log messages for different reasons for the function completing if needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With