#axum #lambda #tower #aws

axum-aws-lambda

Tower Layer for compatibility between Axum and AWS Lambda Runtime

4 releases (breaking)

0.4.0 Dec 2, 2022
0.3.0 Oct 18, 2022
0.2.0 Jul 26, 2022
0.1.0 Jun 13, 2022

#1325 in Network programming

Download history 80/week @ 2022-12-02 35/week @ 2022-12-09 26/week @ 2022-12-16 8/week @ 2022-12-23 11/week @ 2022-12-30 197/week @ 2023-01-06 98/week @ 2023-01-13 148/week @ 2023-01-20 44/week @ 2023-01-27 182/week @ 2023-02-03 191/week @ 2023-02-10 73/week @ 2023-02-17 42/week @ 2023-02-24 67/week @ 2023-03-03 541/week @ 2023-03-10 309/week @ 2023-03-17

975 downloads per month

MIT license

13KB
117 lines

axum-aws-lambda

Rust crates.io

This crate provides a tower::Layer that translates hyper/axum requests to the format used by the aws-lambda-rust-runtime crate. This allows users to switch between just running a Hyper server, and running under the Lambda runtime - this dramatically speeds up development! It also means that you can use off-the-shelf components from the Tower ecosystem!

Check out examples/main.rs: running in debug mode runs a hyper server, and building for release mode compiles using the Lambda runtime.

Testing out the Lambda runtime locally

I have also provided an example Dockerfile & python script for locally spinning up a lambda runtime:

cargo build --release
docker build . -t lambda-test
docker run -p 9000:8080 lambda-test
python test_lambda_runtime

Dependencies

~13–19MB
~419K SLoC