2

I created the configurations to be able to invoke my lambda function directly using sam CLI. The configuration copy is shown below (using code lens).

function invoking example

When I click F5 or press the run button to debug my function it breaks every time in a file that is not in my project called index.js created in the runtime (/var/runtime/index.js) (I believe it's related to sam CLI debugging feature).

This stalls my development process as I expect it breaks directly at the breakpoint I put in the code.

Steps to reproduce: 1- Run sam init 2- Choose option 1 (1 - AWS Quick Start Templates) 3- Choose option 2 (2 - Image (artifact is an image uploaded to an ECR image repository) 4- Choose option 1 (1- amazon/nodejs14.x-base) 5- Go to app.js file then click on the code lens option (add debug configuration)

Codelens add debug configuration

6- Go to run and debug tab in VS code then select the function configuration you just created and then click the run button

invoke sam function

Observed result: It breaks at a breakpoint that does not exist

unexpected behavior

Expected result: To break at the breakpoint that I put by myself in the code

Additional environment details (Ex: Windows, Mac, Amazon Linux, etc) OS: macOS Big Sur version: 11.5.1 sam --version: SAM CLI, version 1.31.0 AWS region: US East

stijndepestel
  • 3,076
  • 2
  • 18
  • 22

0 Answers0