It's debugging the wrong file when the debugger starts up.
Using SAM CLI 1.40 and latest VS Code. I followed directions here:
Here's my launch.json entry, generated by following directions above:
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "videoPostUpload",
"invokeTarget": {
"target": "code",
"projectRoot": "${workspaceFolder}/my-lambda-fn/videoPostUpload",
"lambdaHandler": "index.lambdaHandler"
},
"lambda": {
"runtime": "nodejs14.x",
"payload": {},
"environmentVariables": {}
}
}
Here's my function:
exports.lambdaHandler = async event => {
const response = { //breakpoint here works properly, after /var/runtime/index.js!
statusCode: 200,
body: {
message: "Hello SAM!"
}
};
return response;
};
Instead, it launches /var/runtime/index.js first - even though there's no breakpoints in that file. Minor problem, but annoying if I include Lambda functions in my compound debugging configs, in launch.json. I'd rather not stop the debugger at this file every time I'm debugging across my entire platform.
Is there a way to exclude this file? Am I configured incorrectly?