-
Notifications
You must be signed in to change notification settings - Fork 202
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
Lambda sink refactor #4766
Merged
Merged
Lambda sink refactor #4766
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
# Lambda Processor | ||
|
||
This plugin enables you to send data from your Data Prepper pipeline directly to AWS Lambda functions for further processing. | ||
|
||
## Usage | ||
```aidl | ||
lambda-pipeline: | ||
... | ||
processor: | ||
- aws_lambda: | ||
aws: | ||
region: "us-east-1" | ||
sts_role_arn: "<arn>" | ||
function_name: "uploadToS3Lambda" | ||
max_retries: 3 | ||
mode: "synchronous" | ||
batch: | ||
batch_key: "osi_key" | ||
threshold: | ||
event_count: 3 | ||
maximum_size: 6mb | ||
event_collect_timeout: 15s | ||
``` | ||
|
||
## Developer Guide | ||
|
||
The integration tests for this plugin do not run as part of the Data Prepper build. | ||
The following command runs the integration tests: | ||
|
||
``` | ||
./gradlew :data-prepper-plugins:aws-lambda:integrationTest -Dtests.processor.lambda.region="us-east-1" -Dtests.processor.lambda.functionName="lambda_test_function" -Dtests.processor.lambda.sts_role_arn="arn:aws:iam::123456789012:role/dataprepper-role | ||
|
||
``` | ||
|
||
|
||
# Lambda Sink | ||
|
||
This plugin enables you to send data from your Data Prepper pipeline directly to AWS Lambda functions for further processing. | ||
|
||
## Usage | ||
```aidl | ||
lambda-pipeline: | ||
... | ||
sink: | ||
- aws_lambda: | ||
aws: | ||
region: "us-east-1" | ||
sts_role_arn: "<arn>" | ||
function_name: "uploadToS3Lambda" | ||
max_retries: 3 | ||
batch: | ||
batch_key: "osi_key" | ||
threshold: | ||
event_count: 3 | ||
maximum_size: 6mb | ||
event_collect_timeout: 15s | ||
dlq: | ||
s3: | ||
bucket: test-bucket | ||
key_path_prefix: dlq/ | ||
``` | ||
|
||
## Developer Guide | ||
|
||
The integration tests for this plugin do not run as part of the Data Prepper build. | ||
The following command runs the integration tests: | ||
|
||
``` | ||
./gradlew :data-prepper-plugins:aws-lambda:integrationTest -Dtests.sink.lambda.region="us-east-1" -Dtests.sink.lambda.functionName="lambda_test_function" -Dtests.sink.lambda.sts_role_arn="arn:aws:iam::123456789012:role/dataprepper-role | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,10 @@ dependencies { | |
testAnnotationProcessor 'org.projectlombok:lombok:1.18.20' | ||
testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' | ||
testImplementation project(':data-prepper-test-common') | ||
testImplementation project(':data-prepper-plugins:parse-json-processor') | ||
testImplementation testLibs.slf4j.simple | ||
testImplementation 'org.mockito:mockito-core:4.6.1' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' | ||
} | ||
|
||
test { | ||
|
@@ -59,9 +61,13 @@ task integrationTest(type: Test) { | |
classpath = sourceSets.integrationTest.runtimeClasspath | ||
|
||
systemProperty 'log4j.configurationFile', 'src/test/resources/log4j2.properties' | ||
systemProperty 'tests.sink.lambda.region', System.getProperty('tests.sink.lambda.region') | ||
systemProperty 'tests.sink.lambda.functionName', System.getProperty('tests.sink.lambda.functionName') | ||
systemProperty 'tests.sink.lambda.sts_role_arn', System.getProperty('tests.sink.lambda.sts_role_arn') | ||
systemProperty 'tests.lambda.sink.region', System.getProperty('tests.lambda.sink.region') | ||
systemProperty 'tests.lambda.sink.functionName', System.getProperty('tests.lambda.sink.functionName') | ||
systemProperty 'tests.lambda.sink.sts_role_arn', System.getProperty('tests.lambda.sink.sts_role_arn') | ||
|
||
systemProperty 'tests.lambda.processor.region', System.getProperty('tests.lambda.processor.region') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove processor properies? |
||
systemProperty 'tests.lambda.processor.functionName', System.getProperty('tests.lambda.processor.functionName') | ||
systemProperty 'tests.lambda.processor.sts_role_arn', System.getProperty('tests.lambda.processor.sts_role_arn') | ||
|
||
filter { | ||
includeTestsMatching '*IT' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...er-plugins/aws-lambda/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# To enable mocking of final classes with vanilla Mockito | ||
# https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#mock-the-unmockable-opt-in-mocking-of-final-classesmethods | ||
mock-maker-inline |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove processor doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the developer guide for running integ tests here. We can remove the usage sections after they are added to Opensearch documentation website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to have 2 different readme for lambda processor and sink?