0

I'm trying to debug AWS lambda (python) function created using container image locally on VSCode. I don't want to use SAM CLI as my Directory structure don't contain template.yml. Is there a way to debug the code in VSCode while running the container from the image for AWS Lambda?

Bells2025
  • 1
  • 3

1 Answers1

0

I refer to this page which can help.

Add the following code to your launch.json:

Windows:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${env:USERPROFILE}/.dotnet/tools/dotnet-lambda-test-tool-6.0.exe",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        }
    ]
}

Linux and Mac:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${env:HOME}/.dotnet/tools/dotnet-lambda-test-tool-6.0",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        }
    ]
}
MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13