debugging 在VS代码中本地调试AWS Lambda(Python),而不使用SAM-CLI

yebdmbv4  于 2022-11-14  发布在  Python
关注(0)|答案(1)|浏览(142)

我正在尝试调试使用VSCode上的本地容器映像创建的AWS lambda(python)函数。我不想使用SAM CLI,因为我的目录结构不包含template.yml。在从AWS Lambda的映像运行容器时,是否有办法调试VSCode中的代码?

dbf7pr2w

dbf7pr2w1#

我指的是这个page,它可以提供帮助。
将以下代码添加到launch.json中:
视窗:

{
    "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和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"
        }
    ]
}

相关问题