I have a client who uploads x amount of files to an S3 bucket. Currently, I have a lambda that processes the files that go into that bucket- but it triggers upon each file being uploaded. The problem is, I have no idea how many files the client will upload at once- it could be one file, or it could be up to ten. I have some logic in the lambda that returns a different output depending on how many files have been uploaded.
I came across Want to upload multiple files to S3 and only when all are uploaded trigger a lambda function - Stack Overflow which I really like the sound of- however I am not sure how to set it up (or what the policies for multiple file uploads will be). I should be able to get my lambda to subscribe to a topic easy enough, but how do I notify an SNS topic that a batch (which can vary in number) of files have been uploaded in a single instance?