Skip to content

Address feedback on Lamda page #9895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions _data-prepper/pipelines/configuration/processors/aws-lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@

The [AWS Lambda](https://aws.amazon.com/lambda/) integration allows developers to use serverless computing capabilities within their OpenSearch Data Prepper pipelines for flexible event processing and data routing.

## AWS Lambda processor configuration

The `aws_lambda` processor enables invocation of an AWS Lambda function within your Data Prepper pipeline in order to process events. It supports both synchronous and asynchronous invocations based on your use case.

## Configuration fields

You can configure the processor using the following configuration options.

Field | Type | Required | Description
-------------------- | ------- | -------- | ----------------------------------------------------------------------------
Field | Type | Required | Description
:--- | :------- | :--- | :---
`function_name` | String | Required | The name of the AWS Lambda function to invoke.
`invocation_type` | String | Required | Specifies the invocation type, either `request-response` or `event`. Default is `request-response`.
`aws.region` | String | Required | The AWS Region in which the Lambda function is located.
Expand All @@ -29,18 +28,24 @@
`lambda_when` | String | Optional | A conditional expression that determines when to invoke the Lambda processor.
`response_codec` | Object | Optional | A codec configuration for parsing Lambda responses. Default is `json`.
`tags_on_match_failure` | List | Optional | A list of tags to add to events when Lambda matching fails or encounters an unexpected error.
`sdk_timeout` | Duration| Optional | Configures the SDK's client connection timeout period. Default is `60s`.
`sdk_timeout` | Duration | Optional | Configures the SDK's client connection timeout period. Default is `60s`.

Check failure on line 31 in _data-prepper/pipelines/configuration/processors/aws-lambda.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _data-prepper/pipelines/configuration/processors/aws-lambda.md#L31

[OpenSearch.Spelling] Error: SDK's. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.
Raw output
{"message": "[OpenSearch.Spelling] Error: SDK's. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_data-prepper/pipelines/configuration/processors/aws-lambda.md", "range": {"start": {"line": 31, "column": 61}}}, "severity": "ERROR"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was renamed to connection_timeout, we can update other fields as well - reference-link

`response_events_match` | Boolean | Optional | Specifies how Data Prepper interprets and processes Lambda function responses. Default is `false`.

#### Example configuration
The `invocation_type` field is not supported in Amazon OpenSearch Ingestion pipelines using the `aws_lambda` processor. Including this field will result in a validation error.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this field in the table above if it is not supported? Are there discrepancies between these docs and what AWS supports? If so are they documented anywhere? In my mind adding just this blurb adds more confusion.

Copy link
Contributor Author

@Naarcha-AWS Naarcha-AWS Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpash: Based on your experience (issue #9872), that would seem to be the case. That being said, I have no additional insight on what additional discrepancies may exist between Data Prepper, OSI, and what AWS supports. This PR is only meant to address feedback on the AWS Lamda page specifically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dlvenable or @srikanthjg: Is there an alternative method or parameter for adjusting the invocation_type? Should we just remove the field and section from the docs entirely?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for opensource dataprepper, this field is needed an is used in both lambda processor and sink.

  1. request-response (default for the processor): This is mapped to AWS Lambda's
    "RequestResponse" invocation type. When using this mode. This is synchronous processing, where the pipeline waits for the Lambda result

  2. event (default for the sink): This is mapped to AWS Lambda's "Event" invocation type.
    When using this mode The request is sent to Lambda asynchronously and Data Prepper doesn't wait for a response

{: .note}


## Usage

This example configures the `aws_lambda` processor to invoke a Lambda function with advanced batching, conditional invocation, retry logic, and cross-region AWS credentials:

```
processors:
- aws_lambda:
function_name: "my-lambda-function"
invocation_type: "request-response"
response_events_match: false
aws:
arn: "arn:aws:lambda:us-west-2:123456789012:function:my-processing-function"
timeout: 2000
batch_size: 10
aws:
region: "us-east-1"
sts_role_arn: "arn:aws:iam::123456789012:role/my-lambda-role"
max_retries: 3
Expand All @@ -51,11 +56,10 @@
maximum_size: "5mb"
event_collect_timeout: PT10S
lambda_when: "event['status'] == 'process'"

```
{% include copy-curl.html %}

## Usage
## Invocation types

The processor supports the following invocation types:

Expand Down