S3 Object Lambda Support #479
-
Hi, is there any way to implement S3 Object Lambdas with the current runtime and, if so, is there any documentation/example of it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes, that's possible. You'll need to write the struct to represent the S3ObjectEvent because it doesn't look like it's defined in the Looking at the examples, in the documentation, this is how the code would look like, roughly: use lambda_runtime::{service_fn, Error, LambdaEvent};
use aws_lambda_events::s3::object_lambda::S3ObjectLambdaEvent;
pub(crate) async fn my_handler(event: LambdaEvent<S3ObjectLambdaEvent>) -> Result<(), Error> {
let object = event.payload.;
// Do something useful with the object here
Ok(())
} You can use the S3 SDK to write responses: https://docs.rs/aws-sdk-s3/0.11.0/aws_sdk_s3/client/struct.Client.html#method.write_get_object_response Let me know if that helps. |
Beta Was this translation helpful? Give feedback.
Yes, that's possible. You'll need to write the struct to represent the S3ObjectEvent because it doesn't look like it's defined in the
aws_lambda_events
crate.Looking at the examples, in the documentation, this is how the code would look like, roughly:
You can use the S3 SDK to write responses:
https://docs.rs/aws-sdk-s3/0.11.0/aws_sdk_s3/client/struct.Client.html#method.write_get_object_r…