Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop a Lambda function in Python

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?

like image 798
Rudiger Avatar asked Aug 10 '18 06:08

Rudiger


1 Answers

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.

like image 121
Davos Avatar answered Nov 01 '22 20:11

Davos