Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I attach Visual Studio debugger to pulumi up

Tags:

pulumi

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?

like image 436
mbergal Avatar asked Sep 04 '19 15:09

mbergal


People also ask

Does Visual Studio have a built in debugger?

The Visual Studio debugger can help you navigate through code to inspect the state of an app and show its execution flow. You can use keyboard shortcuts, debug commands, breakpoints, and other features to quickly get to the code you want to examine.

How do I add Debug points in Visual Studio?

To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

How do you attach a debugger to a process in Visual Studio?

You can attach the Visual Studio debugger to a running process on a local or remote computer. After the process is running, select Debug > Attach to Process or press Ctrl+Alt+p in Visual Studio, and use the Attach to Process dialog to attach the debugger to the process.

How do I debug a program in Visual Studio?

To attach to a process on your local computer: In Visual Studio, select Debug > Attach to Process (or press Ctrl+Alt+P) to open the Attach to Process dialog box. In the Available processes list, find and select the process or processes you want to attach to. In the Attach to field, make sure the type of code you plan to debug is listed.

How do I debug a process on a remote computer?

To debug a process on a remote computer, see Attach to a process on a remote computer. To attach to a process on your local computer: In Visual Studio, select Debug > Attach to Process (or press Ctrl+Alt+P) to open the Attach to Process dialog box. Connection type should be set to Default.

How do I install the pulumi plugin?

Install Pulumi provider: arch -x86_64 pulumi plugin install resource {provider_name} v {version} (where {provider_name} is the name of the provider, i.e. aws and {version} is the same version number that your package has updated to) * Login to Pulumi using the appropriate backend (see our docs for information)

How do I use Visual Studio debugger in Docker container?

Starting in Visual Studio 2019, you can attach the Visual Studio debugger to a process running on a Docker container. For a Linux .NET Core Docker container, see Attach to a process running on a Linux Docker container. For a Windows Docker container, see Attach to a process running on a Windows Docker container.


3 Answers

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

like image 68
Shawn Avatar answered Jan 03 '23 11:01

Shawn


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.

like image 32
aryeh Avatar answered Jan 03 '23 11:01

aryeh


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

like image 40
Matias Montivero Avatar answered Jan 03 '23 12:01

Matias Montivero