Useful if you want more control over the API between the init and LocalStack (e.g. for error responses)
-
Build init via
make build- On ARM hosts, use
make ARCH=arm64 buildbecause debugging only works with native containers.
- On ARM hosts, use
-
Start LocalStack with the following flags:
LAMBDA_INIT_BIN_PATH=/Users/joe/Projects/LocalStack/lambda-runtime-init/custom-tests/init/var/rapid/init LAMBDA_INIT_BOOTSTRAP_PATH=/Users/joe/Projects/LocalStack/lambda-runtime-init/custom-tests/init/var/rapid/entrypoint.sh LAMBDA_INIT_DEBUG=1 LAMBDA_INIT_DELVE_PATH=/Users/joe/Projects/LocalStack/lambda-runtime-init/custom-tests/init/var/rapid/dlv LAMBDA_INIT_DELVE_PORT=40000 LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT=3600 TEST_DISABLE_RETRIES_AND_TIMEOUTS=1LAMBDA_INIT_DEBUG=1|0enables or disables RIE copying and debugging.LAMBDA_REMOVE_CONTAINERS=0keeps exited containers- Adjust the path to
lambda-runtime-initaccordingly
-
Start Delve debugger and connect to
localhost:40000
Within create_lambda_function:
- Increase the
timeout=3600 - On ARM hosts, debugging only works with ARM containers. Use
LAMBDA_IGNORE_ARCHITECTURE=1or explicitly configure the Lambda function withArchitectures=[Architecture.arm64]