Fork me on GitHub

Commands (CLI)

Pulumi is controlled primarily using the command line interface (CLI). The Pulumi service works in conjunction with the CLI to carry out tasks such as deploying updates to your cloud program and infrastructure, and keeping a history of who updated what in your team and when. This CLI has been designed to work well in unattended scenarios, such as in continuous integration and deployment, and communicates all errors properly using non-zero exit codes.

Common Commands

The most common commands in the CLI that you’ll be using are as follows:

  • pulumi new: creates a new project using a template
  • pulumi stack: manage your stacks (at least one is required to perform an update)
  • pulumi config: configure variables such as keys, regions, and so on
  • pulumi up: preview and deploy changes to your program and/or infrastructure
  • pulumi preview: preview your changes explicitly before deploying
  • pulumi destroy: destroy your program and its infrastructure when you’re done

Complete Reference

Below is the complete documentation for all available commands:

pulumi

Synopsis

Pulumi - Cloud Native Infrastructure as Code

To begin working with Pulumi, run the ‘pulumi new’ command:

$ pulumi new

This will prompt you to create a new project for your cloud and language of choice.

The most common commands from there are:

- pulumi up       : Deploy code and/or resource changes
- pulumi stack    : Manage instances of your project
- pulumi config   : Alter your stack's configuration or secrets
- pulumi destroy  : Tear down your stack's resources entirely

For more information, please visit the project page: https://pulumi.io

Options

      --color colors.Colorization    Colorize output. Choices are: always, never, raw, auto (default always)
  -C, --cwd string                   Run pulumi as if it had been started in another directory
      --disable-integrity-checking   Disable integrity checking of checkpoint files
  -e, --emoji                        Enable emojis in the output (default true)
  -h, --help                         help for pulumi
      --logflow                      Flow log settings to child processes (like plugins)
      --logtostderr                  Log to stderr instead of to files
      --profiling string             Emit CPU and memory profiles and an execution trace to '[filename].[pid].{cpu,mem,trace}', respectively
      --tracing string               Emit tracing to a Zipkin-compatible tracing endpoint
  -v, --verbose int                  Enable verbose logging (e.g., v=3); anything >3 is very verbose

SEE ALSO

Auto generated by spf13/cobra on 16-Oct-2018

Command-line Completion

The Pulumi CLI also has a command to generate a command-line completion script for Bash. This gives you tab completion for all commands, sub-commands, and flags, which can make it easier to remember what to type and where.

To use this, you’ll first need to ensure bash completion is installed:

  • On most current Linux distros, bash completion should be available.
  • On a Mac, install with brew install bash-completion.

The pulumi gen-bash-completion <FILE> command self-generates its own CLI script, and saves it to the given <FILE>. The location of this file also differs based on whether you’re using Linux or Mac:

  • On Linux, save to /etc/bash_completion.d/pulumi.
  • On macOS, save to /usr/local/etc/bash_completion.d/pulumi.

Ensure that bash completion is run when you launch a new terminal by adding it to ~/.bash_profile.

On Linux:

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

On macOS:

if [ -f /usr/local/etc/bash_completion ]; then
    . /usr/local/etc/bash_completion
fi

Finally, after saving the pulumi bash completion script, either reopen your terminal or source your profile in order to reload the bash completion scripts in your current terminal session (. ~/.bash_profile).