install rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
add the x86_64-unknown-linux-musl
target to rustup:
rustup target add x86_64-unknown-linux-musl
install zip:
sudo apt install zip
build project using predefined target:
cargo build --release --target x86_64-unknown-linux-musl
Store the built application in a zip:
zip -j rust.zip ./target/x86_64-unknown-linux-musl/release/bootstrap
To update the function code after the lambda has been created:
aws lambda update-function-code \
--zip-file fileb://./rust.zip \
--function-name FUNCTION_NAME \
--region REGION
See this resource for more details, including instructions for building on MacOS.