Rust for AWS Lambda, the Docker Way

by beebon 11/22/2024, 4:16 PMwith 7 comments

by newfocogion 11/26/2024, 7:34 PM

One of the massive benefits for Rust on Lambda is (as the author mentions) "extremely low start-up time, CPU usage and memory footprint". It's not clear to me if deploying Rust to Lambda via a docker image actually negates some of those benefits.

by tiew9Viion 11/26/2024, 9:26 PM

An alternative to this is to statically compile and use scratch docker image.

Another tip is if writing a http app etc Axum/Actix have Lambda shims.

I add a cli flag “—lambda” which enables the shim. That means I can run the app locally, in Kubernetes, ECS, Lambda with minimum effort. It also makes dev easier pretending lambda doesn’t exist.