aws_lambda_events 0.2.7

AWS Lambda event definitions
Documentation

aws_lambda_events

Build Status Documentation

This crate provides strongly-typed AWS Lambda event structs in Rust.

Installation

Include the crate in your Cargo.toml:

[dependencies]
aws_lambda_events = "^0.2.7"

Usage

The crate itself has no AWS Lambda handler logic and instead exists to serialize and deserialize AWS Lambda events into strongly-typed Rust structs.

The types defined in this crate are usually used with handlers / runtimes provided by the official Rust runtime or community projects such as rust-aws-lambda, rust-crowbar, and serverless_rust.

For a list of supported AWS Lambda events and services, see the crate reference documentation.

How it works

This crate is automatically generated by aws_lambda_events_codegen. It parses event definitions from the official Go SDK and thus is generally up-to-date. Additionally, tests with example events are generated to check correctness and any documentation comments are preserved and used in rustdoc.

Dealing with null and empty strings in AWS Lambda input

The official Lambda Go SDK sometimes marks a field as required when the underlying Lambda event json could actually be null or an empty string. Normally, this would cause a panic as Rust is much more strict.

This crate deals with this reality by marking all required json string fields as Option<String> in Rust. Json null or the empty string are deserialized into Rust structs as None.

Contributing

All files in the generated directory should not be manually edited and are generated by aws_lambda_events_codegen. Any changes for files in generated must happen in aws_lambda_events_codegen.

We have no desire to manually write event definitions and contributions to that effect will not be accepted. If the official Go SDK is missing an event definition, please file a bug on that project rather than submitting a fix here. Once the official Go SDK has included your changes this project will pick up the new event definitions.

Manual changes to wrap the generated event definitions or implement Rust-specific ergonomic improvements will be enthusiastically accepted.