Skip to main content

VS Code

Marketplace Download Version Rating

Serverless Debugger's VS Code extension allows you to debug your AWS Lambda functions written in NodeJS and Python. With a small configuration, debugging is as simple as a click of a button.

Introduction

Start online debug sessions while the AWS Lambda functions run on AWS Cloud. Thundra sets up an easy and secure connection between your AWS Lambda functions and VSCode. Debug your serverless applications natively with their own permissions. Stop mocking resources and simulating the environments! Put breakpoints and pause the execution of the NodeJS and Python functions to see the stack trace.

Installation

In order to use Serverless Debugger's VS Code extension, you need to complete all installation steps. Please follow the instructions below.

1

Install the extension from the marketplace

See it on VS Code Marketplace

2

Get your Debug Token

Sign up for ServerlessDebugger and get your SLSDEBUGGER_AUTH_TOKEN from this page.

info

If you want to try ServerlessDebugger you can get a free 7 days auth token from here

3

Edit VS Code and AWS Environment variables

  • Open the Command Palette (⇧⌘P) or (Ctrl + Shift + P) and select ServerlessDebugger: Edit Configuration command.

    VS Code Status BarVS Code Command Panel, select ServerlessDebugger: Edit Configuration

  • Paste the auth token to the authToken field.

    VS Code Status BarVS Code Configuration file, paste your authToken

4

Edit AWS Environment variables

Go to your AWS Console and set your auth token value with the SLSDEBUGGER_AUTH_TOKEN key as your environment variable.

VS Code Status Bar

5

Instrument your function

After installing the extension, instrument your AWS Lambda. You can instrument your NodeJS and Python applications to use VS Code Extension.

note

If you need any help, please join our Discord channel and get personal help from the contributors.

How to use

After completing the installation steps, follow the guides below to start using Lambda Debugger.

▶️

Start debugger

Click on the “Start ServerlessDebugger Debugger” button on the Status Bar. You can also execute the command ServerlessDebugger: Start Debugger to start the debugging session.

VS Code Status Bar

🛑

Set a breakpoint

Set a debug point on your VS Code. You can set multiple debug points as well.

⚡️

Invoke your function

Now invoke your Lambda function to hit on the debug point. When there is a hit on your breakpoint the status bar below turns red.

VS Code Status Bar

🔍

Happy debugging!

You can start debugging when the variables and the call stack are loaded.

VS Code Status Bar

tip

Debug session ends when your AWS Lambda function times out. You can update the timeout of your function for longer debug sessions.

Commands

  • ServerlessDebugger: Start Debugger to start the debugger with the current profile's settings
  • ServerlessDebugger: Start Debugger (with a session name) to start the debugger with the given session name
  • ServerlessDebugger: Change active profile to change the active profile to the one given in your config file
  • ServerlessDebugger: Edit configuration to edit the JSON file containing your debugger configuration

You can access all of the above commands from the command palette (Cmd+Shift+P or Ctrl+Shift+P).

Self-Hosted Broker

A self-hosted instance of the broker that provides the necessary functionality for online debugging can be installed on your own AWS account using our CDK application. Please follow this guide to learn more.

Issues

Issues can be reported through the Discord.