I am trying to figure out the logic for processing multiple files in S3 at once as files are added randomly.  For discussion sake here's an example:

Files are added randomly to S3 bucket; an by bursty or at random intervals
Lambda function is triggered once 9 files are in the S3 bucket; the lambda function post processes or combines these files together.
Once processed, the files will be moved to another bucket or deleted.

Here's what I've tried:

I have S3 triggers for all S3 puts
In my lambda function I ignore the filename itself and list the S3 bucket based on the key to count how many files exist
problem is when traffic is bursty or arrives steady but at a rapid pace it is difficult to identify unique groups of 9 files
I have uuid prefixes on file names for performance reasons so sequential filenames don't exist.
I've considered writing meta data to a nosql db but haven't gone down that route yet.
You could also think of using the step function that triggers lambda/glue job to copy the files further to Redshift/s3, introduce some file counts logic (assuming fix number of files are arriving)/a wait time (e.g., 30 minutes assuming all files have landed). This is not the perfect solution, but if you fix the flow of files, it may work perfectly fine.
Execute lambda function for multiple files in S3