actix_lambda-0.2.0 doesn't have any documentation.
actix_lambda
Helper libraries for running/testing Actix servers under AWS Lambda
Currently, it just consists of a simple helper function run
that will run the entire app as a lambda function, and lambda_test
which will feed in a single Application Load Balancer event into the Lambda app.
Usage
use ;
In addition to the Rust code, there's also some Python work with CloudFormation and Troposphere to enable building stacks with this. To deploy this do the following:
- Have a CLI-configured AWS account
rustup target add x86_64-unknown-linux-musl
brew install filosottile/musl-cross/musl-cross
(or do Linux-equivalent steps to get a Musl cross-compiler)mkdir .cargo && echo '[target.x86_64-unknown-linux-musl]\nlinker = "x86_64-linux-musl-gcc"' > .cargo/config
cargo build --release --target x86_64-unknown-linux-musl
- This may fail, especially if you're using something that uses OpenSSL. The notes at https://www.andrew-thorburn.com/cross-compiling-a-simple-rust-web-app/#compiling may well help you
- cd <copy of the helpers directory from here>
pip install -r requirements.txt
python cf.py <path to your app's root>
- This will make a CloudFormation stack named after your app, and then do some custom configuration of the TargetGroup and Listener for the ALB to workaround an upstream bug
You should now be able to run your app from the URL that the script spat out.
TODO
- Mechanisms for splitting up Actix apps into multiple Lambda functions
- Improved test functions with multiple varied requests
- Rewrite Troposphere work into pure CloudFormation with Rust once https://forums.aws.amazon.com/thread.jspa?threadID=294551 gets resolved