To test drive your
lambda in a productive environment you can use the Debugger within Functions. Simply click on the "Debug" tab of while developing your
lambda. Your code will then be executed inside an environment where all of Functions' features (e.g. Secrets, Payload and Domain Whitelist) are at its disposal.
Please be aware that the debugger differs in the fact that it has more resources compared to a regular function and also it has no execution timeout to allow debugging.
The debugging interface consists of three main parts:
- The Editor allows you to place breakpoints at which debugging execution will halt. Simply add/remove breakpoints by clicking the grey gutter on its left side of the corresponding line number.
- Use the Output to gain more insights about your
lambdasexecution. It displays the logs generated by console.debug/.info/.warn/.error statements in addition to the output of execution itself, whether it resulted in an error or success.
- The Sidebar hosts various functionalities: the Actions, the Payload-Editor and the Variable Inspector.
Start the Debugger
Start the debug execution
Resume to the next breakpoint
Stepover to the next line of code
Stop and Restart debug execution
Stop the debug execution
|Initial||In this state the Debugger hasn't been started yet.
To startup the Debugger, press the button. After startup the debug of your lambda code will directly be started.
|Start Up||The Debugger is starting up. This will take around 30 seconds.|
|Ready||The Debugger is currently idle i.e. ready to be started.
To start debugging, press the button and the Debugger will start to debug your lambda code.
|Loading||The Debugger is loading your lambda code. This might take up to 20s to complete.|
|Running||The Debugger is currently executing the code. After a while the Debugger should either enter the Paused state or - if reached the end of the lambda code - back to its Ready state|
|Paused||The Debugger is paused. In this state you can inspect variables via the Variable Inspector.|
|Crashed||The Debugger has crashed and will try to recover.|
The Payload Editor enables you to edit and reset the payload that input to your
lambda. Initially this is set to the default of your
lambdas event but can be modified to fit custom scenarios. You can also reset the payload here if you want to recreate the initial payload.
Payloads will be retained client-side for your convenience. If you want to reset to the original payload you will have to do so explicitly in the editor.
If there is a breakpoint set, the debugger will pause at the next breakpoint in the code flow. In this state you can inspect the current values of your variables and the environment variables. There is however a limit in regards to the maximum depths of properties.