How can I trigger AWS CodeBuild once after multiple file uploads to S3?

0
7
Asked By CodeCrafter42 On

I'm looking for ways to ensure that AWS CodeBuild only gets triggered once after multiple files are uploaded to an S3 bucket, instead of initiating a build for each individual file. I came across a thread on AWS Re:Post that discusses similar challenges, but the references seem outdated or unclear. My project involves scanning files uploaded to S3 with ClamAV; if any infected files are found, they need to be moved to a quarantine bucket. The ideal setup would involve:

1. An upload of multiple files (let's say 10) to S3.
2. Triggering CodeBuild only after all files are completely uploaded.
3. Using a Lambda function, possibly with SQS, to manage this process, as S3 doesn't directly trigger CodeBuild.

I'm hoping to find useful articles, blog posts, or documentation that might guide me in implementing this. Any suggestions on how to effectively manage batch uploads in this manner would be appreciated!

2 Answers

Answered By TechWhiz92 On

One idea is to upload a "done.txt" file last, which would then trigger the Lambda function. This Lambda could read the "done.txt" file to gather the names of the previously uploaded files. It’s not the perfect solution yet, but it's definitely a start! You might want to consider this approach.

Answered By DevGuru88 On

You really need a middle layer to check when all your files are uploaded. It’s essential for triggering CodeBuild only when everything is in place. You could actually trigger the Lambda directly without involving a queue. It’s simpler that way!

FileFinder77 -

That’s true, but I’m curious how you'd ensure that all uploads are finished?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.