pulumi(1)
Pulumi is an infrastructure as code platform for building, deploying, and managing cloud resources using programming languages.
Synopsis
pulumi [COMMAND] [OPTIONS]Description
Pulumi enables you to write infrastructure as code in languages like Python, Go, TypeScript, C#, and Java. It manages cloud resources across AWS, Azure, GCP, and other providers through a single unified interface.
Projects are defined in a Pulumi.yaml file, and resources are declared in code rather than YAML templates. Pulumi maintains a state file to track deployed resources and handle updates, replacements, and deletions automatically.
The CLI provides commands for creating projects, deploying stacks, previewing changes, and managing cloud resources across multiple environments.
Common options
| Flag | What it does |
|---|---|
-s, --stack STACK | Select a specific stack to operate on (e.g., 'dev', 'prod') |
--color auto|always|never | Control colored output in the terminal |
--cwd DIR | Run the command in a specific directory |
--json | Output results in JSON format for scripting |
--skip-version-check | Skip checking for newer CLI versions |
--logtostderr | Log output to stderr instead of stdout |
-v, --verbose | Enable verbose logging for debugging |
--secrets-provider PROVIDER | Specify secrets backend (e.g., 'passphrase', 'awskms') |
Examples
Create a new Pulumi project using the AWS TypeScript template
pulumi new aws-typescriptPreview changes that would be deployed to the 'prod' stack without making changes
pulumi preview -s prodDeploy changes to the 'dev' stack automatically without confirmation prompt
pulumi up -s dev --yesTear down all resources in the 'staging' stack
pulumi destroy -s stagingList all available stacks for the current project
pulumi stack listSet the AWS region configuration for the 'prod' stack
pulumi config set aws:region us-west-2 -s prodExport the state of the 'prod' stack to a backup file
pulumi export -s prod > backup.jsonStream logs from the 'dev' stack in real-time
pulumi logs -s dev --follow