Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit df133a1

Browse files
authored
add additional docs on lambda devx config (#1577)
1 parent fac9259 commit df133a1

File tree

1 file changed

+39
-7
lines changed
  • content/en/user-guide/lambda-tools/debugging

1 file changed

+39
-7
lines changed

content/en/user-guide/lambda-tools/debugging/index.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,42 @@ When enabled, Lambda Debug Mode automatically adjusts timeouts to accommodate de
454454

455455
For further customization, you can use a configuration file.
456456
Specify the path to this file with the `LAMBDA_DEBUG_MODE_CONFIG_PATH` environment variable, ensuring the
457-
file is mounted.
458-
In most cases, manually setting `LAMBDA_DOCKER_FLAGS` is unnecessary when using this configuration.
457+
file is mounted into the LocalStack container.
458+
Manually setting `LAMBDA_DOCKER_FLAGS` is unnecessary when using this configuration.
459459

460-
{{< command >}}
461-
LAMBDA_DEBUG_MODE=1 \
462-
LAMBDA_DEBUG_MODE_CONFIG_PATH=debug_config.yaml \
463-
localstack start
464-
{{< /command >}}
460+
Here is an example of mounting a `debug_config.yaml` in your LocalStack container to start your Debug Mode:
461+
462+
{{< tabpane >}}
463+
{{< tab header="LocalStack CLI" lang="shell" >}}
464+
LOCALSTACK_LAMBDA_DEBUG_MODE=1 \
465+
LOCALSTACK_LAMBDA_DEBUG_MODE_CONFIG_PATH=/tmp/debug_config.yaml \
466+
localstack start --volume /path/to/debug-config.yaml:/tmp/lambda_debug_mode_config.yaml
467+
{{< /tab >}}
468+
{{< tab header="Docker Compose" lang="yaml" >}}
469+
version: "3.8"
470+
471+
services:
472+
localstack:
473+
container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
474+
image: localstack/localstack-pro # required for Pro
475+
ports:
476+
- "127.0.0.1:4566:4566" # LocalStack Gateway
477+
- "127.0.0.1:4510-4559:4510-4559" # external services port range
478+
- "127.0.0.1:443:443" # LocalStack HTTPS Gateway (Pro)
479+
environment:
480+
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
481+
- DEBUG=${DEBUG:-0}
482+
- LAMBDA_DEBUG_MODE=1
483+
- LAMBDA_DEBUG_MODE_CONFIG_PATH=/tmp/debug_config.yaml
484+
volumes:
485+
- "./debug_config.yaml:/tmp/debug_config.yaml"
486+
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
487+
- "/var/run/docker.sock:/var/run/docker.sock"
488+
{{< /tab >}}
489+
{{< /tabpane >}}
490+
491+
Any change to the configuration file on your local filesystem would be automatically picked by the LocalStack container.
492+
After debugging a Lambda function, its associated container will automatically stop.
465493

466494
The configuration file should contain a `functions` block where you can define debug settings
467495
for each specific Lambda function ARN.
@@ -527,3 +555,7 @@ functions:
527555

528556
* [Lambda Code Mounting and Debugging (Python)](https://github.com/localstack/localstack-pro-samples/tree/master/lambda-mounting-and-debugging)
529557
* [Spring Cloud Function on LocalStack (Kotlin JVM)](https://github.com/localstack/localstack-pro-samples/tree/master/sample-archive/spring-cloud-function-microservice)
558+
* [Enable Lambda Debug Mode to Automatically Raise Execution Timeouts (Java)](https://github.com/localstack-samples/localstack-pro-samples/tree/master/lambda-debug-mode/java/base-enable-lambda-debug-mode)
559+
* [Enable Lambda Debug Mode to Automatically Raise Execution Timeouts (Python)](https://github.com/localstack-samples/localstack-pro-samples/tree/master/lambda-debug-mode/python/base-multiple-lambda-debug-mode)
560+
* [Enable Lambda Debug Mode to Automatically Raise Execution Timeouts for multiple Lambdas (Python)](https://github.com/localstack-samples/localstack-pro-samples/tree/master/lambda-debug-mode/python/base-multiple-lambda-debug-mode)
561+
* [Enable Lambda Debug Mode to Automatically Handle Concurrent Function Invocations (Python)](https://github.com/localstack-samples/localstack-pro-samples/tree/master/lambda-debug-mode/python/base-concurrent-lambda-debug-mode)

0 commit comments

Comments
 (0)