Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Lambda DebugNew to Visual Studio Code? Get it now.
Lambda Debug

Lambda Debug

Jonathan Damon

|
2,717 installs
| (0) | Free
Run and Debug AWS lambda functions locally.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Lambda Debug

This is a Visual Studio Code extension that allows for debugging of AWS Lambda python functions within the IDE. After a little bit of setup, debugging is as simple as the click of a button.

Setup

There are a few settings you need to set before you start debugging. You can access these settings by going directly to your settings.json, or by clicking the settings button at the bottom left corner of the page and navigating to Settings->Extensions->Lambda Debug. Please use forward slashes (/) for all paths.

Format: {fullsettingname}{* == required} ({type} - {defaultValue})

lambdadebug.masterDirectory* (string - null):

This is an absolute path to the directory that contains all of your services. Oftentimes, this is the folder that contains all your git repositories. For example, this could be:

      /mnt/c/Users/username/Documents/git

lambdadebug.workingDirectories* (list - []):

This is a list of the services that are contained within your Master Directory. This must be the folder from which the service gets deployed. For instance, if you use Serverless Framework, this would be the folder that contains your serverless.yml file. These working directories get appended to the end of your masterDirectory (with a forward slash [/] put between them). For example, your workingDirectories setting may look like this:

      ["my-service", "my-second-service/lambdas"]

lambdadebug.eventsDirectory (string - ""):

This is a path to a directory of events. You can optionally create a folder structure within your events directory that is identical to your workingDirectory structure. This allows for easy event selection. This path gets appended to the end of your masterDirectory (with a forward slash [/] put between them). For example, your workingDirectories setting may look like this:

      myEvents

The structure of this folder may be like the following:

my-events
│
└───my-service
│   │   event1.json
│   │   event2.json
│
└───my-second-service
    │
    └───lambdas
        │   event1.json
        │   event1.json

lambdadebug.pythonPath (string - "${PYTHONPATH}"):

This is your PYTHONPATH environment variable. Usually, the default value of "${PYTHONPATH}" works just fine, however, this is a good place to add any local modules that you may use in your services. For example:       "/mnt/c/Users/username/Documents/MyModule:${PYTHONPATH}"

lambdadebug.awsStages (array - []):

This is a list of your AWS stages OR an object containing awsStage: awsProfile key-value pairs. The setStage command uses this to determine the possible stages you can select from.

lambdadebug.awsStage (string - "dev"):

This is your AWS_STAGE environment variable. If you are running this in a stage that is not dev, it is import to change this. The simplest way to do so is by using the lambdadebug.setStage command.

lambdadebug.awsProfile (string - "default"):

This is your AWS_PROFILE environment variable. If you have multiple AWS profiles, it is important to set this. Otherwise, it will use the default AWS profile.

lambdadebug.buttonText (string - "Debug Lambda"):

Choose what text will be displayed on the button that you use to debug your lambdas.

Debugging

To debug, click the debug button on the right side of the Status Bar (only for python files). Your lambdadebug.buttonText setting will be displayed here (default of "Debug Lambda"). A dialog box should appear that will allow you to select a lambda event (json file). After an event is selected, the debugging should begin.

At this time, the context object a basic lambda context object and cannot yet be changed.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft