mbergal
mbergal

Reputation: 664

How can I attach Visual Studio debugger to pulumi up

I have a stack defined in TS and cannot understand what is going on.

Is there a way to attach Visual Studio Code debugger to pulumi?

Upvotes: 10

Views: 2196

Answers (4)

ΩmegaMan
ΩmegaMan

Reputation: 31721

Using Visual Studio 2023

Steps Screenshot
Visual Studio Put a debug break point on a line such as in program.cs.
Command Line Run the command line pulumi up --attach-debugger
Wait for the pulumi to halt processing and look for it to report a process id. Pulumi up --attach-debugger
Visual Studio Within Visual Studio select the menu item Debug -> Attach To Process.
Visual Studio
Attach To Process
Sort the process Ids.
Visual Studio

Attach To Process

Find the ID and attach
Sort, Find and Attach to process
Visual Studio Should break on the debug line set in the first step

Upvotes: 0

aryeh
aryeh

Reputation: 318

My vscode version:

❯ code --version
1.63.0
7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e
x64

package.json:

package.json screenshot with vscode debugger prompt

Notice the "debug" prompt above the scripts section. In between lines 5 and 6. You can click that and vscode will open up a debug console. Works perfectly.

Upvotes: 3

Matias Montivero
Matias Montivero

Reputation: 11

You can use in javaScript Debug Terminal. This can be found in the left panel of visual Studio Code, precisely the run option. This option offers a JavaScript Debug Terminal button, this will open a new terminal with attached debugger. This work for me

Upvotes: 1

Shawn
Shawn

Reputation: 889

There appears to be an open issue on this since May 2018. Looks like there is still a lot of work to be done to enable this.

https://github.com/pulumi/pulumi/issues/1372

Upvotes: 6

Related Questions