S3 Upload Trigger ( Multiple Files )

Viewed 28

I have a foo lambda that executes some code by reading some files.

I only want to run the lambda after I upload the 10 required files, which is the tricky part.

  1. 10 files are uploaded in S3 bucket via bitbucket pipeline
  2. ??? (need to wait for all new CSVs to be uploaded)
  3. Execute foo lambda

If I use S3 upload trigger it will not work because it will call the lambda 10 times for each file upload...

The 10 files already exist in the S3 repo, I just replace them.

Any ideas how to run only the foo lambda ONCE after the 10 files are uploaded?

1 Answers

The AWS Lambda function will be triggered for every object created in the Amazon S3 bucket.

There is no capability to ask for the Lambda function to run only after 10 files are uploaded.

You will need to add custom code to the Lambda function to determine whether it is 'ready' to trigger your work (and the definition of 'ready' is up to you!).

Related