python-lambda-local icon indicating copy to clipboard operation
python-lambda-local copied to clipboard

unable to debug in vscode

Open cs-a50494 opened this issue 8 years ago • 5 comments
trafficstars

It would be nice to have a setup for debugging in vscode.

cs-a50494 avatar Nov 14 '17 03:11 cs-a50494

PR is welcomed.

yxd-hde avatar Dec 14 '17 08:12 yxd-hde

Did anyone ever get this figured out? I had it on Mac, but can't get debugging working on Windows :(

mark-bixler avatar Nov 01 '18 16:11 mark-bixler

Can someone help me configure python-lambda-local under VSC (Windows 10) please ?

maxmonterumisi avatar Dec 12 '18 15:12 maxmonterumisi

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

emepetres avatar Feb 16 '19 10:02 emepetres

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"
    }
}

ggaller avatar May 15 '23 11:05 ggaller