#aws #lambda #docker #build #ec2

app aws-build

Build Rust crates for deployment to AWS EC2 or AWS Lambda

3 releases

new 0.9.2 Oct 17, 2020
0.9.1 Sep 12, 2020
0.9.0 Sep 12, 2020

#173 in Network programming

Apache-2.0

23KB
393 lines

aws-build

crates.io Documentation

Build a Rust project in a container for deployment to either an instance running AWS Linux 2 or AWS Lambda.

Both a library and an executable are provided. The executable is a very thin wrapper around the library.

This crate only handles building the project locally. It does not interact with any AWS services.

Executable

Install with:

cargo install aws-build

In the common case you should be able to just run aws-build al2 or aws-build lambda in the directory of the project you want to build.

On successful completion, the output file (either a standalone executable for Amazon Linux 2 or a zip file containing a "bootstrap" executable for AWS Lambda) is written to a subdirectory of the target directory. There is also a target/latest-al2 or target/latest-lambda symlink that points to the output file.

aws-build <mode> [<project>] [--container-cmd <container-cmd>] [--rust-version <rust-version>] [--strip] [--bin <bin>]

Build the project in a container for deployment to AWS.

mode: al2 or lambda (for Amazon Linux 2 or AWS Lambda, respectively)
project: path of the project to build (default: current directory)

Options:
  --container-cmd   container command (default: docker)
  --rust-version    rust version (default: latest stable)
  --strip           strip debug symbols
  --bin             name of the binary target to build (required if there is
                    more than one binary target)
  --help            display usage information

Related projects

  • amazon-linux: Docker image replicating the Aamazon Linux environment.
  • cargo-aws-lambda: "dependency free cargo subcommand for cross-compiling, packaging and deploying code quickly to AWS Lambda"
  • docker-lambda: "A sandboxed local environment that replicates the live AWS Lambda environment almost identically"
  • lambda-rust: "a faithful reproduction of the actual AWS [...] Lambda runtime environment" with the stable Rust toolchain installed

Dependencies

~6.5MB
~122K SLoC