Skip to content

pulumi/pulumi-vscode-tools

Repository files navigation

Visual Studio Code Pulumi Tools

The extension for developers building Pulumi applications.

Note: This extension is in a public beta. If you have suggestions for features or find bugs, please open an issue.

IAC Features include:

Demo

Getting Started

Install the software

  1. Get a free Pulumi account at http://app.pulumi.com/.
  2. Install Pulumi 3.132.0 (or greater) using these instructions.
  3. Install the Pulumi Tools extension using Visual Studio Marketplace.

Using Pulumi IaC

This extension allows you to launch and debug Pulumi programs within VS Code.

Install Pulumi CLI

When pulumi isn't on your PATH, the extension automatically installs the Pulumi CLI using the Installation Script method, to ~/.pulumi/bin.

The pulumi.root configuration setting allows you to customize the install location. Do not include the bin/ folder in the value.

Open a Project

Open a new or existing Pulumi project as a VS Code workspace. This extension supports both single-folder workspaces and multi-root workspaces.

Start Debugging

Pulumi programs are run (with or without debugging) using a launch configuration. Select the Run and Debug icon in the Activity Bar on the side of VS Code, then use an automatic debug configuration or create a launch configuration file for your project.

The extension automatically generates a debug configuration to run pulumi up or pulumi preview for the current Pulumi stack. To use an automatic debug configuration, do the following:

  1. Select the Run and Debug icon.
  2. Choose Show all automatic debug configurations.
  3. Select "Pulumi..." then "pulumi preview" or "pulumi up". Debugging will start automatically.

Automatic Debug Configuration

Automatic Debug Configuration

  1. Select or create a stack if prompted to do so.

Stack Selection

Alternatively, you can select and launch a configuration through the Command Palette (⇧⌘P) by filtering on Debug: Select and Start Debugging.

Create a Launch Configuration

To create a customized launch configuration, do one of the following:

  1. When selecting an automatic debug configuration, click the gear icon to customize the configuration.
  2. Create a launch.json file and use a configuration template.

Launch Configuration

The extension provides the following configuration templates:

  • pulumi up
  • pulumi preview

The following properties are supported:

name string The configuration name.
type string Use pulumi.
request string Use launch.
command string Deployment command (up, preview).
stackName string The name of the stack to operate on. If not specified, user is prompted to select a stack.
workDir string Run Pulumi as if it had been started in another directory.
env object Environment variables for the Pulumi CLI.
noDebug boolean Run without debugging.

Debug your Program

Set breakpoints in your program code and enjoy the full functionality of the VS Code debugger. See "Debugging" for more information.

Debugging

Pulumi CLI Output

Access the CLI output via the Debug Console view.

Debug Console

Run without Debugging

To run without debugging, do one of the following:

  1. With a launch configuration selected, select Run Without Debugging on the Run menu.
  2. Add "noDebug": "true" property to your launch configuration.

Using Pulumi ESC

This extension allows you to manage ESC environments without leaving VS Code.

Open the ESC Explorer

From the primary sidebar, open the "Pulumi ESC Explorer" view, and click "login" to authenticate to Pulumi Cloud.

Once logged in, you should see a tree of your organizations and, within each organization, your ESC environments.

Pulumi ESC Explorer

Create or Edit an Environment

Click the plus sign on an organization or project node to create an environment. By clicking on an environment in the tree or creating a new environment, the extension will open an editor. Edit the environment definition and save to create a new revision.

Add ESC Environment

Open an Environment

On the right side of the editor, click the Preview button to open the environment. You will be prompted for an output format.

Open ESC Environment

Delete an Environment

If you hover over an environment, there is a icon that will delete the environment; you will be asked to enter the environment name to confirm.

Delete ESC Environment

Decrypt an Environment

If you hover over an environment, there is a icon that will decrypt the environment without opening it. This is useful in a clone/move scenario.

Decrypt ESC Environment

Refresh Environments

If you get out of date, you can always refresh using the icon at the top right of the Pulumi ESC Explorer tree view. The extension auto refreshes only after a change.

Refresh ESC Environment

Search Environments

Click the search icon in the top right, type in a search term, and see results in the pane that appears.

Refresh ESC Environments

Tag a Revision

Click the tag icon on a revision and give it a name.

Tag ESC Environment Revision

ESC Run in Terminal

You can quickly populate an ESC Run command for an environment in the terminal.

ESC Run in Terminal

Go to Definition/Find all References

Both Go to Definition and Find all References are supported across symbols, interpolations, and values.

Diff/Compare Environments and Revisions

You can compare anything, two revisions, or two environments, or any combination.

Right or Control-click the first node to compare in the tree and click Select for compare.

Then right or control-click on another node and select Compare with Selected

Logout

Go to the Account icon at the bottom left, select your Pulumi Cloud account, and sign out.

Releases

See the Releases section for latest release information.

About

A Visual Studio Code Extension for Pulumi

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •