By using AWS re:Post, you agree to the Terms of Use

S3 file drop fire multiple Lambdas

0

Have a customer who uses an application to drop a data file from Salesforce into an S3 bucket. Once the file is dropped, they have a Lambda that fires and does some processing.

Customers question is there a way to fire multiple Lambdas from the same trigger? In this case, the creation of the file in the bucket. Doesn't look like this is supported today, any work arounds?

Looked at doing this via CloudWatch but it doesn't support prefix/suffix lookup on the file.

2 Answers
0
Accepted Answer

instead of triggering a Lambda from an S3 event, you can also chose SNS as event destination. Lambda supports SNS as event source and SNS allows you to have multiple subscriptions for one topic. The new architecture would look like:
S3 -> SNS -> multiple Lambdas

answered 4 years ago
0

Having just answered a related question posted 9 DEC 2021, I found this 3-year old answer. For those looking at this answer in 2021 and beyond, there is another good answer, too. That answer is: Try using EventBridge

There are 10 EventBridge AWS Events for S3 including CreateObject. An EventBridge Rule can be set up to trigger multiple, separate Lambda Functions any time an object is created in S3 aka doing a file drop in S3. Each AWS Event in EventBridge has its own schema, for example: aws.s3@CreatedObject is the EventBridge schema for the AWSEvent that represents a new object being added to an S3 bucket. Using EventBridge for the Event Notifications in S3 to trigger Lambda Functions, one might find more capable solutions especially given that an EventBridge Rule can have matching patterns to filter the AWS Events giving more granular control over the post-processing of the S3 Event.

TheSpunicorn

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions