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:
- Run your Pulumi program from within Visual Studio Code.
- Launch your program under a debugger.
- Automatically generate a launch configuration for a Pulumi project.
- Explorer for Pulumi ESC (Environments, Secrets, and Configuration).
- Get a free Pulumi account at http://app.pulumi.com/.
- Install Pulumi 3.132.0 (or greater) using these instructions.
- Install the Pulumi Tools extension using Visual Studio Marketplace.
This extension allows you to launch and debug Pulumi programs within VS Code.
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 new or existing Pulumi project as a VS Code workspace. This extension supports both single-folder workspaces and multi-root workspaces.
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:
- Select the Run and Debug icon.
- Choose Show all automatic debug configurations.
- Select "Pulumi..." then "pulumi preview" or "pulumi up". Debugging will start automatically.
- Select or create a stack if prompted to do so.
Alternatively, you can select and launch a configuration through the Command Palette (⇧⌘P) by filtering on Debug: Select and Start Debugging.
To create a customized launch configuration, do one of the following:
- When selecting an automatic debug configuration, click the gear icon to customize the configuration.
- Create a launch.json file and use a configuration template.
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. |
Set breakpoints in your program code and enjoy the full functionality of the VS Code debugger. See "Debugging" for more information.
Access the CLI output via the Debug Console view.
To run without debugging, do one of the following:
- With a launch configuration selected, select Run Without Debugging on the Run menu.
- Add
"noDebug": "true"
property to your launch configuration.
This extension allows you to manage ESC environments without leaving VS Code.
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.
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.
On the right side of the editor, click the Preview button to open the environment. You will be prompted for an output format.
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.
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.
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.
Click the search icon in the top right, type in a search term, and see results in the pane that appears.
Click the tag icon on a revision and give it a name.
You can quickly populate an ESC Run command for an environment in the terminal.
Both Go to Definition and Find all References are supported across symbols, interpolations, and values.
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
Go to the Account icon at the bottom left, select your Pulumi Cloud account, and sign out.
See the Releases section for latest release information.