I am working on a requirement where I want to trigger the AWS Lambda function written in Java when a file is uploaded on S3 bucket. The condition is that the function should pick-up the latest file in the bucket. Right now, I have the lambda function which picks up the specified file (having already specified file name). But as per the requirement, the file name can be anything(eg. web-log-). Is there any way to do that?
Since with lambda functions, we have access to the event object, can I use it to find out the recently uploaded file?