Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make AWS Lambda stop execution?

I have an AWS Lambda function does operations against Kinesis Firehose. The function uses backoff mechanism. (which at this time I think wasting my computation time).

But anyway, in some point in my code, I would like to fail the execution. What command should I use in order to make the execution stop?

P.s. I found out that there are commands such as:

  • context.done()
  • context.succeed()
  • context.fail()

I've got to tell you, I could not find any documentation about these commands in AWS documentation.

like image 246
johni Avatar asked Jul 29 '16 13:07

johni


1 Answers

Those methods are available only for backward compatibility, since they were first introduced with Node.js v0.10.42. If you use NodeJS version 4.* or 6.*. Use the callback() function.

Check: Using the Callback Parameter in Lambda for more information how to take advantage of this function.

like image 87
David Gatti Avatar answered Sep 27 '22 18:09

David Gatti