Search code examples
typescriptdebuggingaws-cdk

Debugging TypeScript AWS CDK application


Is it possible to debug an AWS CDK TypeScript application? If need for example check which value are in particular variable?

For example in Java are breakpoints. But how can i check that flow goes in the expected way, if have: if (someVariable) {...} in TypeScript code? How can check that if condition is true?


Solution

  • You can debug AWS CDK applications by simply running it in the language that it is written in. This is easily doable in both Jetbrains IDE's or VSCode. Just execute the index.ts or app.py in debug mode.

    The only problem is that context variables in AWS CDK are not available. I uncomment these manually while debugging.

    For typescript, you execute the Javascript file and it should help you to debug to make the changes in Typescript

    enter image description here