#aws-lambda #lambda #axum #aws #tower #axum-server #tower-layer

axum-aws-lambda

Tower Layer for compatibility between Axum and AWS Lambda Runtime

7 releases (breaking)

0.6.0 Dec 22, 2023
0.5.1 Dec 12, 2023
0.5.0 May 8, 2023
0.4.0 Dec 2, 2022
0.1.0 Jun 13, 2022

#822 in Network programming

Download history 609/week @ 2023-12-04 760/week @ 2023-12-11 873/week @ 2023-12-18 258/week @ 2023-12-25 678/week @ 2024-01-01 1070/week @ 2024-01-08 1112/week @ 2024-01-15 2443/week @ 2024-01-22 3256/week @ 2024-01-29 3683/week @ 2024-02-05 3579/week @ 2024-02-12 2864/week @ 2024-02-19 2952/week @ 2024-02-26 2987/week @ 2024-03-04 3417/week @ 2024-03-11 4198/week @ 2024-03-18

13,561 downloads per month

MIT license

14KB
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 --example main
docker build . -t lambda-test
docker run -p 9000:8080 lambda-test
python test_lambda_runtime

Dependencies

~12–24MB
~418K SLoC