#aws-lambda #axum #tower

axum-aws-lambda

Tower Layer for compatibility between Axum and AWS Lambda Runtime

10 breaking releases

0.11.0 Dec 8, 2025
0.10.0 Jan 21, 2025
0.9.0 Oct 8, 2024
0.8.0 Jul 31, 2024
0.2.0 Jul 26, 2022

#650 in Network programming

Download history 1143/week @ 2025-09-21 880/week @ 2025-09-28 3139/week @ 2025-10-05 2290/week @ 2025-10-12 1015/week @ 2025-10-19 739/week @ 2025-10-26 2164/week @ 2025-11-02 1582/week @ 2025-11-09 1967/week @ 2025-11-16 1356/week @ 2025-11-23 1866/week @ 2025-11-30 970/week @ 2025-12-07 1048/week @ 2025-12-14 998/week @ 2025-12-21 265/week @ 2025-12-28 973/week @ 2026-01-04

3,294 downloads per month
Used in senax

MIT license

15KB
116 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

There is an example Dockerfile for locally spinning up a lambda runtime:

cargo build --release --example main
docker build . -t lambda-test
docker run -p 9000:8080 lambda-test

In test-lambda-runtime/ there is a python script for testing and a Dockerfile for running it.

In another shell, from the root of this repository:

cd test-lambda-runtime
docker build . -t test_lambda_runtime
docker run --network="host" test_lambda_runtime

Dependencies

~18–32MB
~426K SLoC