-
Notifications
You must be signed in to change notification settings - Fork 846
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
Support natively processing s3 events with lambda deployments #478
Comments
Hey @mallikvala, if I understand your goals correctly you can trigger a download from the event by using a pipeline:
processors:
- cache:
cache: bucket
operator: get
key: ${! json("path.to.s3.item") }
resources:
caches:
bucket:
s3:
bucket: foo My mind's a little fuzzy on what the event looks like that gets sent to the lambda function but if you can log it and post it here I can update this example. |
Labelling this as documentation as it would be cool to have some examples like this in the lambda section of the docs. |
@Jeffail wont using |
Hey @mallikvala, if you want to process the S3 files as line delimited messages then you can use the pipeline:
processors:
- cache:
cache: bucket
operator: get
key: ${! json("path.to.s3.item") }
- unarchive:
format: lines
- split: {}
resources:
caches:
bucket:
s3:
bucket: foo Another thing to keep in mind is that the cache processor might fail (if the key is not found, etc) and the message will continue through the pipeline, you can choose from a range of options for handling the errors: https://www.benthos.dev/docs/configuration/error_handling |
I've repurposed this issue as an enhancement because using caches is a pretty weak user experience here and since this is a somewhat common pattern with AWS there ought to be a better way to do this, ideally with minimal effort on the configuration side. However, this still needs to be explicit in order to preserve backwards compatibility. |
Hey @Jeffail , this can probably be an enhancement but any suggestions on how to trigger an
s3
input in lambda in a scenario where alambda
is triggered during aputObject
operation on an s3 bucket.currently, when invoked a single
part
is created with the event andprocessor
chain is invoked without anyinput
. the event as such wont make much sense until the file is downloaded. looking for suggestions.The text was updated successfully, but these errors were encountered: