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
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).
134
+
135
+
Running the following command will start a emphemeral 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`)
With your application build and packaged, it's ready to ship to production. You can also invoke it locally to verify is behavior using the [lambdaci :provided docker container](https://hub.docker.com/r/lambci/lambda/) which is also a mirror of the AWS Lambda provided runtime with build dependencies omitted.
147
+
148
+
```bash
149
+
# start a docker container replicating the "provided" lambda runtime
150
+
# awaiting an event to be provided via stdin
151
+
$ unzip -o \
152
+
target/lambda/release/{your-binary-name}.zip \
153
+
-d /tmp/lambda && \
154
+
docker run \
155
+
-i -e DOCKER_LAMBDA_USE_STDIN=1 \
156
+
--rm \
157
+
-v /tmp/lambda:/var/task \
158
+
lambci/lambda:provided
159
+
160
+
# provide an event payload via stdin (typically a json blob)
0 commit comments