Debugging means replaying the execution of an application in some means. Where in serverless applications, more specifically in AWS Lambda applications, replaying the same invocation is not always possible due to its black-box nature.

By using Thundra’s AWS Lambda Debugger VS Code Extension, you can debug your serverless applications natively with their permissions.

Benefits

Installation

To use AWS Lambda Debugger, you need to complete all installation steps. Please follow the instructions below.

  1. Install the extension from the marketplace.

  2. Sign up for Thundra and get your THUNDRA_AGENT_LAMBDA_DEBUGGER_AUTH_TOKEN. You can get your auth token from the start page if you've already signed up.

  3. Add this key to both your VS Code configuration and your AWS Console:

    1. Open the Command Palette (⇧⌘P) and select Thundra: Edit Configuration command to paste the auth token to the authToken field

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

  4. After installing the extension, instrument your AWS Lambda. You can do it in two ways.

    1. Using Layers (easier)

      1. Guide for NodeJS
      2. Guide for Python
    2. Manual instrumentation

      1. Guide for NodeJS
      2. Guide for Python

How to use

Summary

Traditionally, it is impossible to put breakpoints in a Lambda function, stop the execution and debug as usual. Debugging serverless applications locally may make sense in some situations. But it is clear that mocking the cloud environment and debugging serverless applications locally misses some crucial points such as security permissions and authenticity of event data flowing between resources.

You can ease those pains by installing just a single VSCode extension, instrumenting your function without any further steps.