---
schema_version: 1
route: /t/cargo-lambda.md
tool: "cargo-lambda"
---

# sincecutoff.com /t/cargo-lambda — cargo-lambda

- name: cargo-lambda
- kind: cli
- children: none
- homepage: <https://crates.io/crates/cargo-lambda>

Changes to the tools coding agents drive, since a model's training cutoff, each linked to its first-party source. Check installed versions and limitations before acting; a cutoff date does not establish what a model knows.
Original editorial content: [Apache 2.0](https://sincecutoff.com/v1/data-license.txt), by [0xPatrick](https://0xpatrick.dev). Preserve applicable license and [NOTICE](https://sincecutoff.com/notice.txt) attribution when redistributing. Third-party source text and examples retain their own rights. [License scope and attribution](https://sincecutoff.com/v1/license.json).
To stay current, read the changes feed: [`/v1/changes.md?tool=cargo-lambda`](https://sincecutoff.com/v1/changes.md?tool=cargo-lambda) (or `.json`), adding `since=YYYY-MM-DD` for your training cutoff. Entries for registered children are included; the registry itself is `/v1/tools.json`. How to page and save your place: [llms.txt](https://sincecutoff.com/llms.txt).

### cargo-lambda build accepts environment variables (2026-02-15)
- slug: cargo-lambda-build-accepts-environment-variables-7208f8303734
- score: 0.98

How to use it:

When a build needs environment variables, pass them with `--env-var` or load them with `--env-file`; CLI values override metadata, and `--env-var` overrides `--env-file`.

Examples:

```
cargo lambda build --env-var <KEY>=<VALUE>
```

```
cargo lambda build --env-file <PATH>
```

```
[package.metadata.lambda.build]
env_var = ["<KEY>=<VALUE>"]
env_file = "<PATH>"
```

- why_it_matters: Build a project that needs configured environment variables during the cargo build process.
- sources: <https://github.com/cargo-lambda/cargo-lambda/releases/tag/v1.9.0>, <https://github.com/cargo-lambda/cargo-lambda/pull/917>, <https://github.com/cargo-lambda/cargo-lambda/blob/v1.9.0/docs/commands/build.md>
- gotchas: "Version: v1.9.0"; "--env-var <KEY>=<VALUE>: Sets environment variables for the cargo build process. Repeat the flag or give comma-separated pairs."; "--env-file <PATH>: Loads environment variables from a file, one `KEY=VALUE` entry per line."; "env_var: Cargo metadata array of `KEY=VALUE` strings for build-time variables."; "env_file: Cargo metadata path to an environment file for the build."; "Environment files should contain one `KEY=VALUE` entry per line."; "The stated precedence is environment file, then command-line `--env-var`; CLI values override metadata."

### cargo-lambda deploy merges environment variables with --merge-env (2026-02-15)
- slug: cargo-lambda-deploy-merges-environment-variables-with-merge-env-db814b348311
- score: 0.96

How to use it:

When deploying a function and remote environment variables must be preserved, run `cargo lambda deploy --merge-env` with the function name and the environment variables to add or update. Existing remote variables remain; local values take precedence for duplicates.

Examples:

```
cargo lambda deploy --merge-env --env-var NEW_VAR=VALUE <function-name>
```

```
cargo lambda deploy --merge-env --env-vars FOO=BAR,BAZ=QUX <function-name>
```

```
cargo lambda deploy --merge-env --env-file <path> <function-name>
```

- why_it_matters: Deploy a function while preserving environment variables managed outside Cargo Lambda.
- before: Without `--merge-env`, deployment overwrites existing remote environment variables with the variables specified in configuration.
- sources: <https://github.com/cargo-lambda/cargo-lambda/releases/tag/v1.9.0>, <https://github.com/cargo-lambda/cargo-lambda/pull/910>, <https://github.com/cargo-lambda/cargo-lambda/blob/v1.9.0/docs/commands/deploy.md>
- gotchas: "Version: v1.9.0"; "--merge-env: Preserve existing remote environment variables; variables in local configuration are added or updated, with local values taking precedence for duplicates."; "--env-var KEY=VALUE: Set environment variables using KEY=VALUE. May be repeated; docs say it overrides --env-vars and cannot be combined with it."; "--env-vars KEY=VALUE,...: Set environment variables from a comma-separated list. Cannot be combined with --env-var."; "--env-file <path>: Read environment variables from a file with one KEY=VALUE per line."; "function-name (required): Function name argument for the deploy command."; "merge_env: Cargo.toml deploy metadata boolean; `true` enables merging and the default is `false`."; "Prerequisite: Build the function binary before deploying; deploy fails if it cannot find the binary."; "Prerequisite: AWS account permissions for Lambda operations including `lambda:GetFunction`, `lambda:CreateFunction`, and `lambda:UpdateFunctionCode`; an IAM execution role with Lambda privileges is also required."; "Merging is enabled by the `--merge-env` flag or `merge_env = true`; the configuration default is false."; "When a variable is specified remotely and in configuration, the local value takes precedence."

### cargo-lambda watch processes concurrent invocations (2026-02-15)
- slug: cargo-lambda-watch-processes-concurrent-invocations-9c1c41b88c7f
- score: 0.98

How to use it:

When you need local Lambda requests processed simultaneously, run `cargo lambda watch --concurrency 5` to allow up to five function instances, spawned on demand. Instances poll a shared queue, remain warm, and each runs with `AWS_LAMBDA_MAX_CONCURRENCY=1`; the limit is global per function.

Examples:

```
cargo lambda watch --concurrency 5
```

- why_it_matters: Run a local Lambda function with multiple requests handled simultaneously.
- before: By default, `cargo lambda watch` processes Lambda invocations sequentially with a single function instance.
- sources: <https://github.com/cargo-lambda/cargo-lambda/releases/tag/v1.9.0>, <https://github.com/cargo-lambda/cargo-lambda/pull/921>, <https://github.com/cargo-lambda/cargo-lambda/blob/v1.9.0/docs/commands/watch.md>
- gotchas: "Version: v1.9.0"; "--concurrency <maximum instances>: Sets the maximum number of function instances; instances are spawned dynamically based on demand. The documentation example uses `5`."; "Prerequisite: Run `cargo lambda watch` at the root of a Rust workspace."; "Concurrency is limited globally per function."; "Each instance runs in single-worker mode with `AWS_LAMBDA_MAX_CONCURRENCY=1`."
