You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,23 @@
4
4
5
5
This package makes it easy to run AWS Lambda Functions written in Rust. This workspace includes multiple crates:
6
6
7
-
-[](https://docs.rs/lambda)**`lambda`** is a library that provides a Lambda runtime for applications written in Rust.
7
+
-[](https://docs.rs/lambda_runtime)**`lambda-runtime`** is a library that provides a Lambda runtime for applications written in Rust.
8
8
-[](https://docs.rs/lambda_http)**`lambda-http`** is a library that makes it easy to write API Gateway proxy event focused Lambda functions in Rust.
9
9
10
10
## Example function
11
11
12
12
The code below creates a simple function that receives an event with a `firstName` field and returns a message to the caller. Notice: this crate is tested against latest stable Rust.
The code above is the same as the [basic example](https://github.com/awslabs/aws-lambda-rust-runtime/blob/master/lambda/examples/hello-without-macro.rs) in the `lambda` crate.
34
+
The code above is the same as the [basic example](https://github.com/awslabs/aws-lambda-rust-runtime/blob/master/lambda/examples/hello-without-macro.rs) in the `lambda_runtime` crate.
For [a custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html), AWS Lambda looks for an executable called `bootstrap` in the deployment package zip. Rename the generated `basic` executable to `bootstrap` and add it to a zip archive.
Now that we have a deployment package (`lambda.zip`), we can use the [AWS CLI](https://aws.amazon.com/cli/) to create a new Lambda function. Make sure to replace the execution role with an existing role in your account!
Alternatively, you can build a Rust-based Lambda function in a [docker mirror of the AWS Lambda provided runtime with the Rust toolchain preinstalled](https://github.com/softprops/lambda-rust).
129
129
130
-
Running the following command will start a ephemeral docker container which will build your Rust application and produce a zip file containing its binary auto-renamed to `bootstrap` to meet the AWS Lambda's expectations for binaries under `target/lambda/release/{your-binary-name}.zip`, typically this is just the name of your crate if you are using the cargo default binary (i.e. `main.rs`)
130
+
Running the following command will start a ephemeral docker container which will build your Rust application and produce a zip file containing its binary auto-renamed to `bootstrap` to meet the AWS Lambda's expectations for binaries under `target/lambda_runtime/release/{your-binary-name}.zip`, typically this is just the name of your crate if you are using the cargo default binary (i.e. `main.rs`)
131
131
132
132
```bash
133
133
# build and package deploy-ready artifact
@@ -159,12 +159,12 @@ $ unzip -o \
159
159
160
160
## `lambda`
161
161
162
-
`lambda` is a library for authoring reliable and performant Rust-based AWS Lambda functions. At a high level, it provides a few major components:
162
+
`lambda_runtime` is a library for authoring reliable and performant Rust-based AWS Lambda functions. At a high level, it provides a few major components:
163
163
164
164
-`Handler`, a trait that defines interactions between customer-authored code and this library.
165
-
-`lambda::run`, function that runs an `Handler`.
165
+
-`lambda_runtime::run`, function that runs an `Handler`.
166
166
167
-
The function `handler_fn` converts a rust function or closure to `Handler`, which can then be run by `lambda::run`.
167
+
The function `handler_fn` converts a rust function or closure to `Handler`, which can then be run by `lambda_runtime::run`.
0 commit comments