2

When we trigger an AWS Lambda function with an Event Bridge trigger, we typically get one event per lambda invocation.

But the payload to the Lambda function has an array of events (though usually with only one event in it). If there are multiple events one after the other, one Lambda instance is usually triggered for each event.

Is it possible that we will get multiple events in this array? In case of a burst of events, will I get multiple events in the same Lambda function? Or can I assume that each Lambda invocation will have exactly one event?

In my case, I have a burst of events at midnight, and all my calculations of Lambda timeout will go wrong if a single Lambda invocation gets more than one events to process.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Vikas
  • 626
  • 1
  • 10
  • 22

1 Answers1

3

Sadly, event batching is not supported in EventBridge, unless you implement it yourself. Instead you could consider using SQS in between, e.g.

EB----> SQS ---> Lambda

This will allow you to set batching in lambda to get more then one msg from the SQS.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • 1
    Thanks @Marcin I don't want to run a batch of events. I just want to make sure the events do not come in batches. The input payload for the Lambda function triggered from the event bridge is confusing. It is an array of events. So I got worried about any possible batching. I don't see the AWS docs make any concrete statement about that. I just want to be sure that the events come individually and not in batches. – Vikas Aug 17 '22 at 18:52