AWS eventbridge: Document Lambda payload shape and asynchrony for EventBridge targets
Summary
States that target payload shape depends on BatchConfiguration.MaxBatchSize (single JSON object when 1, array otherwise), and notes that after a successful EVENT invoke, delivery is governed by Lambda's at-least-once asynchronous queue, recommending REQUEST_RESPONSE for ordered FIFO processing.
Security assessment
Content concerns delivery/ordering and payload parsing correctness for Lambda targets; no vulnerability or security control is described.
Evidence
+`InvocationType`| `EVENT` invokes asynchronously and treats a successful `Invoke` as delivered. `REQUEST_RESPONSE` waits for the function to return and treats a function error as a failed delivery. After a successful `EVENT` invoke, delivery to the function's code is governed by Lambda's asynchronous queue, which is at-least-once. For ordered processing on a FIFO subscriber, use `REQUEST_RESPONSE`.
Diff
diff --git a/eventbridge/latest/userguide/eb-custom-bus-target-lambda.md b/eventbridge/latest/userguide/eb-custom-bus-target-lambda.md index 32c1325ca..fbd8b2ada 100644 --- a//eventbridge/latest/userguide/eb-custom-bus-target-lambda.md +++ b//eventbridge/latest/userguide/eb-custom-bus-target-lambda.md @@ -11 +11 @@ ParametersDelivery roleBatching and payload -To deliver to a Lambda function, set `TargetArn` to the function ARN, optionally with an alias or version, and add `LambdaParameters`. The function receives a JSON array holding the events in the batch, one element per event, even when the batch holds one event. +To deliver to a Lambda function, set `TargetArn` to the function ARN, optionally with an alias or version, and add `LambdaParameters`. The shape of the payload depends on `BatchConfiguration.MaxBatchSize`. With `MaxBatchSize` set to 1, the function receives the event as a single JSON object. With any other value, or with no `BatchConfiguration`, the function receives a JSON array holding the events in the batch, one element per event, even when the batch holds one event. @@ -17 +17 @@ Parameter| What it sets -`InvocationType`| `EVENT` invokes asynchronously and treats a successful `Invoke` as delivered. `REQUEST_RESPONSE` waits for the function to return and treats a function error as a failed delivery +`InvocationType`| `EVENT` invokes asynchronously and treats a successful `Invoke` as delivered. `REQUEST_RESPONSE` waits for the function to return and treats a function error as a failed delivery. After a successful `EVENT` invoke, delivery to the function's code is governed by Lambda's asynchronous queue, which is at-least-once. For ordered processing on a FIFO subscriber, use `REQUEST_RESPONSE`. @@ -29 +29 @@ The role needs `lambda:InvokeFunction` on the function, including its alias or v -One `Invoke` carries the whole batch as a JSON array. Set `BatchConfiguration.MaxBatchSize` to 1 if the function expects one event per invocation. See [Batching deliveries to a target](./eb-custom-bus-batching.html). +One `Invoke` carries the whole batch as a JSON array. Set `BatchConfiguration.MaxBatchSize` to 1 if the function expects one event per invocation; the function then receives that event as a single JSON object rather than a one-element array. See [Batching deliveries to a target](./eb-custom-bus-batching.html).