Skip to content

S3 Object Lambda Support #479

Discussion options

You must be logged in to vote

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:

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_r…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@calavera
Comment options

@drauziooppenheimer
Comment options

Answer selected by drauziooppenheimer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants