Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way for a Lambda function to be triggered by multiple S3 buckets?

I'm trying to create a Lambda function that will be triggered by any change made to any bucket in the S3 console. Is there a way to tie all create events from every bucket in S3 to my Lambda function?

It appears that in the creation of a Lambda function, you can only select one S3 bucket. Is there a way to do this programmatically, if not in the Lambda console?

like image 846
Bri Avatar asked Nov 07 '22 21:11

Bri


1 Answers

There is at least one way: you can setup an s3 event notifications, for each bucket you want to monitor, all pointing to a single SQS queue.

That SQS queue can then be the event source for your lambda function.

like image 73
E.J. Brennan Avatar answered Nov 15 '22 02:11

E.J. Brennan