0

I have a lambda written in node js which executes every 15 minutes. I need to compare the records processed in the first execution (list of strings to indicate all the records) in the next execution and avoid processing the same records based on the string comparison. So basically first execution will store the info in a list of strings and then in the second execution, I would first compare the records about to get processed with each string present in the collection from first execution. Once done processing the fresh records in the second execution of lambda, I will then replace the string collection.list with new records for the same comparison in the third execution. I figured that we should not be using any global variable as they tend to get changed in the execution. So is there a way to achieve it?

1 Answer 1

1

No you can't save variables like that using Lambda. You can however save the list in a text file on s3. Read this file during next execution and make the necessary edits for the execution after that.

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

1 Comment

okay got it. so basically I am going to have to write the string into a text file and upload it to s3 bucket and keep editing it in each execution. I will check if that would add to the cost for AWS account and proceed with the workaround.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.