Config for lambda internal queue batch size

0

have a query around lambda trigger notifications: sources i am referring to:

  1. https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
  2. https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-example.html

Observations: though trigger from S3 has field records a list in the payload but it has only one record while sqs payloads have a no of events as per the batch size

Query: Couldn’t find if any aggregation happens in lambda’s internal queue, and in case there is any operation happening in the lambda’s internal queue, how can we config the batch size for the internal queue? Add is the batchSize always 1 in case of S3?

2回答
0

Although I can't find any document stating that the batchSize will always be 1 I think it will be.

Nevertheless usually when I implemented these lambda's I used one of the following patterns:

  • just create a loop over the records. just in case it changes in future...
  • refuse events that have > 1 record count, generate an error -> cloudwatch logs -> alarm
profile picture
JaccoPK
回答済み 2年前
0

Only Event source mapping (SQS, Kinesis, MQ, DDB Streams) invocation allow for batching. All other invocation, synchronous (e.g., API Gateway) or asynchronous (e.g., S3, even though there is an internal queue), deliver the events to Lambda with a single event at a time.

If you want to handle S3 events in a batch you can use S3 -> SQS -> Lambda.

profile pictureAWS
エキスパート
Uri
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ