3

I'm looking for a way to temporarily disable Lambda triggers on a DynamoDB. I want to be able do apply manual Updates on a table (e.g. such as importing data from a S3 backup) without the Lambda code being triggers. I tried the disable button next to the trigger in the lambda functions "Trigger" tab. I also tried to disable the whole Stream for the table. In both cases, when reactivating the trigger/stream all the trigger events (that happened, while they were deactivated) are executed then.

How can i prevent this code being triggered?

Thank you very much!

4
  • 5
    When adding the trigger back to the lambda function, what are you setting the starting position to? It needs to be LATEST in this case. If set to TRIM_HORIZON, it will start with the oldest record in the stream (stream records are kept for 24hrs). Commented Jul 26, 2016 at 17:25
  • Ok, i was wondering if this would be the key to my problem. But i am still a little insecure about this. I can set the starting position when creating a trigger from the lambda console. So when i set the trigger to start at LATEST it will do that after being disabled and enabled again manually. But will it also affect how it generally works if there ist some kind of error or bottleneck? Is it still guaranteed, that all events will be handled by the trigger? I'm not quite getting this setting. Not to forget: thank you already, that was an important answer to me! Commented Jul 27, 2016 at 10:16
  • 2
    Setting the starting position ONLY affects where it starts reading the stream from. Other than that, it does not affect the behaviour of the stream at all. Streams will not continue until the lambda function returns successful, so if you encounter errors, the function will be invoked again with the same event data. You have to be careful here, because if it is an error in your code (i.e. not an api call error), you will get stuck at that point. That, however, is an issue to be mindful of regardless of the streams starting position Commented Jul 28, 2016 at 20:29
  • Thank you so much @JonathanSeed! I really had a hard time trying to find out, how this works. The information you provided was was really, really helpful! So thanks again for your effort! Commented Jul 28, 2016 at 20:33

1 Answer 1

1

For others that arrive at this answer - https://alestic.com/2015/11/aws-lambda-kinesis-pause-resume/ provides a CLI solution for pausing stream reading, and resuming from the same place at some point in the future.

Sign up to request clarification or add additional context in comments.

1 Comment

This isn't exactly what the OP is asking about. They want to update the table, then resume stream reading from that point forward, ignoring the changes made during a bulk-update.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.