Skip to main content

Configuration reference

Every LOCH_RUNTIME_* setting is read from the environment or from its flag; the flag wins. The three variables that hold a credential value have no flag, so that it never shows in the process list. Every value is checked at startup: an invalid one stops the runtime (exit code 2) with a message naming the setting, all errors listed at once.

Durations accept Go syntax (1m30s) or seconds (2.5), up to 24 h. Sizes accept bytes or a KiB, MiB or GiB suffix. Switches accept on/true and off/false.

Runtime settings​

VariableFlagDefaultDescription
LOCH_RUNTIME_INVOKE_ADDR--invoke-addr0.0.0.0:8080Listen address of the Invoke API (IP and port)
LOCH_RUNTIME_API_ADDR--runtime-api-addr127.0.0.1:9001Listen address of the Runtime API. Loopback IPv4 only
LOCH_RUNTIME_HEALTH_ADDR--health-addr127.0.0.1:8081Health-only listener used by health. Loopback IPv4 only
LOCH_RUNTIME_BOOTSTRAP--bootstrap/lambda-entrypoint.shProgram run with the handler in the <handler> form. Absolute path
LOCH_RUNTIME_WORKDIR--workdircurrent directory (the image WORKDIR)Working directory of the bootstrap. Absolute path
LOCH_RUNTIME_INIT_TIMEOUT--init-timeout10sInit budget. A longer init keeps running, and its time is charged to the first invocation's timeout
LOCH_RUNTIME_SHUTDOWN_GRACE--shutdown-grace8sTime given to the running invocation on SIGTERM. 0 accepted
LOCH_RUNTIME_MAX_PAYLOAD--max-payload6MiBRequest limit, 1 KiB to 1 GiB. Responses: this limit + 100 bytes, as on AWS Lambda™
LOCH_RUNTIME_QUEUE_SIZE--queue-size16Waiting invocations (0 to 100000)
LOCH_RUNTIME_QUEUE_BYTES--queue-bytesmin(32MiB, memory/8), at least LOCH_RUNTIME_MAX_PAYLOADTotal size of the invocations in memory. A set value below LOCH_RUNTIME_MAX_PAYLOAD is refused
LOCH_RUNTIME_QUEUE_TIMEOUT--queue-timeout30sLongest wait in the queue; beyond, 429
LOCH_RUNTIME_MAX_CONNS--max-conns8 × (queue size + 1), at most 768Open connections to the Invoke API. One source IP may hold an eighth of them, at least 4
LOCH_RUNTIME_AUTH--authonoff disables authentication (development only)
LOCH_RUNTIME_ALLOW_BROWSER--allow-browserfalsetrue accepts requests from web browsers (Origin, Sec-Fetch-Site, Sec-Fetch-Dest, Sec-Fetch-User headers)
LOCH_RUNTIME_LOG_LEVEL--log-levelinfodebug, info, warn, error

Credentials​

Set one bearer source at most, and one source for the SigV4 pair. With authentication on, at least one credential is required. See Authentication.

VariableFlagDescription
LOCH_RUNTIME_TOKEN_SHA256noneHex SHA-256 of the bearer token, 64 characters (recommended)
LOCH_RUNTIME_TOKEN_SHA256_FILE--token-sha256-fileFile holding it
LOCH_RUNTIME_TOKENnonePlain bearer token, 32 printable ASCII characters at least, no space (readable by the function)
LOCH_RUNTIME_TOKEN_FILE--token-fileFile holding the plain bearer token
LOCH_RUNTIME_ACCESS_KEYnone<access key id>:<secret> for SigV4 (readable by the function)
LOCH_RUNTIME_ACCESS_KEY_FILE--access-key-fileFile holding <access key id>:<secret>

Files: absolute paths, regular files of 4 KiB at most, re-read on SIGHUP, refused if the runtime's user could change them.

Function variables​

The function is configured with the AWS variables.

VariableDefaultDescription
AWS_LAMBDA_FUNCTION_NAMEfunctionName accepted in the Invoke URL. 1 to 64 letters, digits, - or _
AWS_LAMBDA_FUNCTION_VERSION$LATESTVersion reported to the function
AWS_LAMBDA_FUNCTION_TIMEOUT300Timeout in seconds, up to 86400. A convention of the RIE, not an AWS variable
AWS_LAMBDA_FUNCTION_MEMORY_SIZEthe cgroup memory limit, else 3008Memory in MB, reported in REPORT and to the function
AWS_REGIONAWS_DEFAULT_REGION, else us-east-1Region of the function ARN
AWS_LAMBDA_LOG_FORMATTextJSON writes the platform log lines as JSON

Environment of the bootstrap​

The bootstrap inherits the container's environment, with these changes:

VariablesChange
AWS_LAMBDA_RUNTIME_APIAlways set to the Runtime API address
AWS_LAMBDA_MAX_CONCURRENCYAlways removed, with a warning
LOCH_RUNTIME_*Always removed
AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_FUNCTION_VERSION, AWS_LAMBDA_FUNCTION_MEMORY_SIZE, AWS_LAMBDA_LOG_GROUP_NAME, AWS_LAMBDA_LOG_STREAM_NAME, AWS_REGION, AWS_DEFAULT_REGION, AWS_LAMBDA_INITIALIZATION_TYPE, AWS_XRAY_CONTEXT_MISSING, LAMBDA_TASK_ROOT, LAMBDA_RUNTIME_DIRSet when absent

No credential is ever invented: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN come from your environment only.


"AWS" and "AWS Lambda" are trademarks of Amazon.com, Inc. or its affiliates. This project is not affiliated with or endorsed by Amazon. It implements the publicly documented AWS Lambda Runtime and Invoke APIs and contains no code from the AWS Lambda Runtime Interface Emulator.