How to use multiple Lambdas to a single S3 used by amazon connect

0

Hi all,

I'm building a contact center that connects to ServiceNow with S3 used in Amazon Connect as a trigger.Lambda is used to connect Servicenow. On the other hand, I'd like to transcribe using Amazon Transcribe.

Is there a way to use multiple Lambda for one S3 bucket? I know it can't be used in the usual way.....

Thanks, Yamamo

3 Answers
1

It's not clear from your question what is happening "under the hood". But taking a guess:

If you have an object delivered to an S3 bucket then you can trigger a Lambda function (you know this already).

You can trigger different Lambda functions depending on the prefix. So for example if you put an object called /example-one/first-file and then another object called /example-two/second-file you can trigger a different Lambda function based on whether objects are in the "folder" example-one or example-two (noting, of course that folders aren't really a construct in S3 but it is handy to think about it that way).

You can also trigger multiple Lambda functions from a single object upload by sending notifications to SNS and then subscribing multiple Lambda functions to that SNS topic.

HTH.

profile picture
EXPERT
answered a year ago
  • I would like a clarification on the prefix. Looking at the documentation I don't see a notification being generated specifically for a prefix/path. Are you talking about some other type of notification trigger? To go along with what you're saying, OP could have a lambda that is triggered every time an object is added. That Lambda then checks the prefix and launches different lambdas.

0

You can configure S3-bucket to post events into EventBridge (instead of triggering Lambda), and then connect multiple targets (Lambda, API-endpoints, etc) to each event. You can also apply filtering and routing rules basing on event type and content (for example filter out some directories on S3 bucket).

Here is a nice blogpost, explaining how to implement it step-by-step.

Vadym
answered a year ago
0

EventBridge provides the ability to use multiple targets as suggested by one of the answer above. It's designed for these type of use cases as it integrates with multiple AWS services which can send events and multiple targets where you can send them for processing. Another important point is integration with 40+ partner targets. SNS can be an option.

The FAQs of EventBridge provides some guidance around choosing between the two. Here is the excerpt from it:

"When should I use Amazon EventBridge and when should I use Amazon SNS?

Both Amazon EventBridge and Amazon SNS can be used to develop event-driven applications, and your choice will depend on your specific needs. Amazon EventBridge is recommended when you want to build an application that reacts to events from SaaS applications and/or AWS services. Amazon EventBridge is the only event-based service that integrates directly with third-party SaaS partners. Amazon EventBridge also automatically ingests events from over 90 AWS services without requiring developers to create any resources in their account. Further, Amazon EventBridge uses a defined JSON-based structure for events, and allows you to create rules that are applied across the entire event body to select events to forward to a target. Amazon EventBridge currently supports over 15 AWS services as targets, including AWS Lambda, Amazon SQS, Amazon SNS, and Amazon Kinesis Streams and Kinesis Data Firehose, among others. At launch, Amazon EventBridge has limited throughput (see service limits) which can be increased upon request, and typical latency of around half a second.

Amazon SNS is recommended when you want to build an application that reacts to high throughput or low latency messages published by other applications or microservices (as Amazon SNS provides nearly unlimited throughput), or for applications that need very high fan-out (thousands or millions of endpoints). Messages are unstructured and can be in any format. Amazon SNS supports forwarding messages to six different types of targets, including AWS Lambda, Amazon SQS, HTTP/S endpoints, SMS, mobile push, and email. Amazon SNS typical latency is under 30 msec. A wide range of AWS services send SNS messages by configuring the service to do so (more than 30, including Amazon EC2, Amazon S3, and Amazon RDS)."

answered a year 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