2
votes

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!

1
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).Jonathan Seed
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!weka1
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 positionJonathan Seed
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!weka1

1 Answers

0
votes

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.