Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/docs/iac/troubleshooting/debugging/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Tools and techniques for diagnosing and fixing Pulumi programs, including debugg
- **[Logging](/docs/iac/troubleshooting/debugging/logging/)** - CLI verbose logging and program logging for debugging and diagnostics
- **[Attaching a debugger](/docs/iac/troubleshooting/debugging/debugger-attachment/)** - Set up debugger attachment for step-by-step program debugging
- **[Performance and tracing](/docs/iac/troubleshooting/debugging/performance-tracing/)** - Analyze deployment performance and trace operations
- **[Debugging providers](/docs/iac/troubleshooting/debugging/debugging-providers/)** - Debug Pulumi providers locally during development
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ meta_image: /images/docs/meta-images/docs-meta.png
menu:
iac:
name: Debugging providers
parent: iac-build-with-pulumi
weight: 40
parent: iac-troubleshooting-debugging
weight: 30
aliases:
- /docs/using-pulumi/pulumi-packages/
- /docs/using-pulumi/pulumi-packages/debugging-provider-packages/
Expand All @@ -17,6 +17,7 @@ aliases:
- /docs/iac/using-pulumi/pulumi-packages/debugging-provider-packages/
- /docs/iac/using-pulumi/extending-pulumi/debugging-providers/
- /docs/iac/extending-pulumi/debugging-providers/
- /docs/iac/build-with-pulumi/debugging-providers/
---

When developing or troubleshooting Pulumi providers, you may need to debug the provider code locally. This guide walks you through starting your provider in debug mode, setting breakpoints, and running tests.
Expand All @@ -31,7 +32,7 @@ For GoLand you can follow these steps.

1. Configure the working directory to the program you are going to run to mirror how Pulumi would start the provider

![Screenshot of GoLand configuration for debugging providers](/docs/iac/build-with-pulumi/img/goland-debug-config.png)
![Screenshot of GoLand configuration for debugging providers](/docs/iac/troubleshooting/debugging/images/goland-debug-config.png)

### Example for VS Code

Expand All @@ -40,12 +41,12 @@ For VS Code you can follow these steps.
1. Navigate to **Run -> Add Configuration** and add the **Go: launch package** configuration
1. Edit `"program": "${fileDirname}"` to point to `cmd/pulumi-resource-<PROVIDER>` , e.g., `cmd/pulumi-resource-azure-native` for the Azure Native provider

![Screenshot of VS Code configuration for debugging providers](/docs/iac/build-with-pulumi/img/vscode-launch-config.png)
![Screenshot of VS Code configuration for debugging providers](/docs/iac/troubleshooting/debugging/images/vscode-launch-config.png)

1. Edit "name": `"Launch Package"` to give it a descriptive name
1. Launch package

![Screenshot of VS Code configuration for debugging providers](/docs/iac/build-with-pulumi/img/vscode-debug-config.png)
![Screenshot of VS Code configuration for debugging providers](/docs/iac/troubleshooting/debugging/images/vscode-debug-config.png)

## Setting breakpoints

Expand Down Expand Up @@ -133,9 +134,9 @@ For VS Code you can follow these steps to connect to the debugger.

1. Navigate to **Run -> Add Configuration** and add the **Go: Connect to server** configuration

![Screenshot of VS Code configuration for debugging providers](/docs/iac/build-with-pulumi/img/vscode-launch-config-connect-to-server.png)
![Screenshot of VS Code configuration for debugging providers](/docs/iac/troubleshooting/debugging/images/vscode-launch-config-connect-to-server.png)

1. Edit "name": `"Connect to server"` to give it a descriptive name
1. Connect to server

![Screenshot of VS Code configuration for debugging tfgen](/docs/iac/build-with-pulumi/img/vscode-debug-config-connect-to-server.png)
![Screenshot of VS Code configuration for debugging tfgen](/docs/iac/troubleshooting/debugging/images/vscode-debug-config-connect-to-server.png)
Loading