I have an AWS Lambda function that reads a CSV file and saves a bunch of records to an SQS queue. There will be thousands of records so they won't fit in one message.
Then there is another Lambda function triggered by that queue that process each record. Each record will take around a second to process.
I need to send an email after all records have been processed.
What's the best way to do it?
I had two ideas:
Make it a FIFO queue and add a
LastRecord: trueattribute to the last record. Send the email when I read that record.Update a DynamoDB table with the total number of records and the total number of processed records and a Lambda function reading the table until
total === processed.
Any better ideas?