AWS Lambda Debugging for Serverless Java
Using the AWS Lambda Debugging with Java Lambda Functions
- 4.Configure runtime
- Java 8
- Change runtime to
- Java 8 (Corretto) and Java 11 (Corretto)
AWS_LAMBDA_EXEC_WRAPPERenvironment variable to
- 6.Start the debug session in your IDE and invoke your function. Thundra Debugger will establish the connection between the IDE and your Lambda function using your authentication token and the session name.
The fastest way to enable the AWS Lambda Debugger for a Lambda function is to set the
THUNDRA_AGENT_LAMBDA_DEBUGGER_AUTH_TOKENenvironment variable to the authentication token that you receive from the Thundra console. By doing this, Thundra will start your function in debug mode and you will be able to connect your function from your IDE to start the debugging session.
The AWS Lambda Debugging feature is disabled by default. However, if you want to manually disable it, you can set the
THUNDRA_AGENT_LAMBDA_DEBUGGER_ENABLEenvironment variable to
false. This ensures that even if you have
THUNDRA_AGENT_LAMBDA_DEBUGGER_AUTH_TOKEN, online debugging will be still disabled.
In order to match the two ends of an online debugging session (your Lambda function invocation and your local IDE), Thundra uses session names. When you enable online debugging in your Lambda function, the session name is set to the predefined value “
default.” If you want to use another session name, you can specify it using the
Thundra’s broker establishes communication between your Lambda function and IDE by receiving data from the Lambda function and then forwarding it to your IDE. To reduce overhead during this transmission process, you need to select a broker host that provides the shortest pathway between your Lambda and IDE. Similarly, the broker host needs to be close to your Lambda function or your IDE location.
Thundra provides a broker host in
Oregonby default, but we also support different broker hosts (listed below). You can select a broker host and set it to the
THUNDRA_AGENT_LAMBDA_DEBUGGER_BROKER_HOSTenvironment variable to reduce latency during a debugging session.
The number of debugging sessions an account can perform is limited for now. Currently, you can start two concurrent debugging sessions at a time. You can contact us at [email protected] or via the intercom bubble on the right-hand bottom corner of the Thundra console if you want to increase your concurrent session limits.