> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/oss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opensoutheners.com/oss/lambdary/configuration/environment-variables.md).

# Environment Variables

Environment variables Lambdary reads, and the ones it sets for your functions.

## Variables Lambdary reads

| Variable             | Meaning                                                                                                                                 |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `LAMBDARY_ROOT`      | Default for `--root` on every command. An explicit `--root` still wins.                                                                 |
| `LAMBDARY_NETWORK`   | Docker network for function containers. Required when Lambdary runs in a container on several networks. Also works outside a container. |
| `LAMBDARY_HOST_ROOT` | Host path of the `--root` directory, when Lambdary runs in a container and can't work it out itself.                                    |
| `LAMBDARY_HOME`      | Lambdary's machine-wide state folder, `~/.lambdary` by default. Holds the process backend's emulator binary and shims.                  |
| `LAMBDARY_RIE_PATH`  | Path to an `aws-lambda-rie` binary for the process backend to use as is, instead of the built-in or built-from-source one.              |
| `NO_COLOR`           | When set, to any value, function output is printed without colors. Colors are also off when output isn't a terminal.                    |

`LAMBDARY_NETWORK` and `LAMBDARY_HOST_ROOT` matter mostly in Docker Compose. See [Docker Compose](https://docs.opensoutheners.com/oss/lambdary/guides/docker-compose.md#settings).

Layer version ARNs are fetched with your own AWS credentials, through the standard AWS SDK credential chain (environment variables, shared config and credentials files, and so on). See [Layers](https://docs.opensoutheners.com/oss/lambdary/guides/layers.md).

## Variables your functions get

Each function's environment is built from, lowest priority first:

1. On the process backend only, the environment `lambdary` itself runs with.
2. The AWS variables, when [`aws.environment`](https://docs.opensoutheners.com/oss/lambdary/configuration/project-config.md#aws) is on.
3. `local.env_file`.
4. `environment` in `.lambda.yml` (or inherited from `defaults:`).
5. The Lambda variables below, which Lambdary always sets.

| Variable                          | Value                                                                                                                             |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `AWS_LAMBDA_FUNCTION_NAME`        | The function's name.                                                                                                              |
| `AWS_LAMBDA_FUNCTION_VERSION`     | The published version number, when a version runs. Not set for `$LATEST`.                                                         |
| `AWS_LAMBDA_FUNCTION_TIMEOUT`     | The function's `timeout` in seconds. With `timeout: 0` (no limit) it is one year, so the emulator never cuts an invocation short. |
| `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` | The function's `memory`, `128` when unset.                                                                                        |

AWS's emulator adds the rest of the Lambda runtime environment itself, such as `AWS_LAMBDA_RUNTIME_API`.

## AWS variables injected with `aws.environment`

With `aws.environment: true` in [`lambdary.yml`](https://docs.opensoutheners.com/oss/lambdary/configuration/project-config.md#aws), functions also get these, unless `local.env_file` or `environment` sets the same name:

| Variable                                                          | Value                                                             |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `AWS_REGION`, `AWS_DEFAULT_REGION`                                | `aws.region`, `us-east-1` by default.                             |
| `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` | `lambdary`. The dev server accepts any credentials.               |
| `AWS_ENDPOINT_URL`                                                | Where the function reaches the dev server, as in the table below. |

| Where the function runs                    | `AWS_ENDPOINT_URL`                                                |
| ------------------------------------------ | ----------------------------------------------------------------- |
| Process backend                            | `http://127.0.0.1:<port>`                                         |
| Container backend, Lambdary in a container | `http://<Lambdary's container name>:<port>` on the shared network |
| Container backend, Lambdary on the host    | `http://host.docker.internal:<port>`                              |

`<port>` is the dev server's port. For the last case Lambdary adds `--add-host=host.docker.internal:host-gateway` to the function's container, and warns at startup when the dev server listens on loopback only, which containers can't reach. Start it with `--host 0.0.0.0`.

`lambdary invoke` without a dev server sets the region and credentials but not `AWS_ENDPOINT_URL`, since nothing answers there. These values replace any `AWS_*` variable of your own shell on the process backend.

## Variables for AWS clients

To point the AWS CLI or an SDK at the dev server, set an endpoint override:

```sh
export AWS_ENDPOINT_URL=http://127.0.0.1:8000             # every service
export AWS_ENDPOINT_URL_LAMBDA=http://127.0.0.1:8000      # Lambda only
export AWS_ENDPOINT_URL_SQS=http://127.0.0.1:8000         # SQS only
export AWS_ENDPOINT_URL_CLOUDWATCH=http://127.0.0.1:8000  # CloudWatch only
```

See [Using AWS SDKs and the CLI](https://docs.opensoutheners.com/oss/lambdary/guides/using-aws-sdks.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opensoutheners.com/oss/lambdary/configuration/environment-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
