python-lambda-local
python-lambda-local copied to clipboard
unable to debug in vscode
It would be nice to have a setup for debugging in vscode.
PR is welcomed.
Did anyone ever get this figured out? I had it on Mac, but can't get debugging working on Windows :(
Can someone help me configure python-lambda-local under VSC (Windows 10) please ?
By using pytest, I'm able to debug it out of the box, without any specific configuration. Just set a break point, and execute the test within vscode.
Probably with unittests or nosetests will work as well: https://code.visualstudio.com/docs/python/unit-testing#_enable-a-test-framework
This is working VS Code debug configuration for launch.json:
{
"name": "Lambda: My Lambda",
"type": "python",
"request": "launch",
"module": "lambda_local",
"args": [
"-l", "${workspaceFolder}/.venv/lib",
"-f", "lambda_handler",
"-t", "180",
"-e", "${workspaceFolder}/env.json",
"${workspaceFolder}/lambda_function.py",
"${workspaceFolder}/events/event.json"
],
"console": "internalConsole",
"internalConsoleOptions": "openOnSessionStart",
"env": {
"AWS_PROFILE": "some-profile",
"AWS_DEFAULT_REGION": "eu-central-1"
}
}