← Back to Home

Pulumi Cheat Sheet

Essential Infrastructure as Code commands

pulumi new
Create a new Pulumi project from template. Choose from various cloud providers and languages.

pulumi new aws-typescript

Keywords: new, create, project, template, initialize

pulumi up
Deploy infrastructure changes. Preview and apply changes to your cloud resources.

pulumi up

Keywords: up, deploy, apply, changes, infrastructure

pulumi preview
Preview infrastructure changes without applying them. Shows what will be created, updated, or deleted.

pulumi preview

Keywords: preview, plan, changes, dry-run, diff

pulumi destroy
Destroy all resources in the stack. Use --yes to skip confirmation prompt.

pulumi destroy --yes

Keywords: destroy, delete, remove, resources, cleanup

pulumi stack
Manage stacks. List, create, select, or remove stacks for different environments.

pulumi stack ls

Keywords: stack, environment, list, select, manage

pulumi stack init
Create a new stack for the current project. Stacks represent different deployment environments.

pulumi stack init production

Keywords: stack, init, create, environment, new

pulumi stack select
Switch to a different stack. Changes the active deployment target.

pulumi stack select staging

Keywords: stack, select, switch, environment, target

pulumi config
Manage configuration values for the current stack. Set secrets and environment-specific values.

pulumi config set aws:region us-west-2

Keywords: config, configuration, set, values, environment

pulumi config set --secret
Set a secret configuration value. Encrypts sensitive data like passwords and API keys.

pulumi config set --secret dbPassword mySecretPassword

Keywords: config, secret, encrypt, password, sensitive

pulumi state
Manage Pulumi state. Export, import, or delete resources from state.

pulumi state delete 'aws:s3/bucket:my-bucket'

Keywords: state, manage, export, import, delete

pulumi refresh
Refresh the state by reading current resource state from cloud provider.

pulumi refresh

Keywords: refresh, sync, state, current, provider

pulumi import
Import existing cloud resources into Pulumi management. Adopt existing infrastructure.

pulumi import aws:s3/bucket:my-bucket existing-bucket-name

Keywords: import, existing, resources, adopt, infrastructure

pulumi export
Export the current stack's state to JSON. Useful for backup or migration.

pulumi stack export --file backup.json

Keywords: export, backup, state, json, migration

pulumi logs
Show logs for the current stack. View deployment history and resource events.

pulumi logs --follow

Keywords: logs, history, events, follow, deployment

pulumi plugin
Manage Pulumi plugins. Install, list, or remove provider plugins.

pulumi plugin install resource aws v6.0.0

Keywords: plugin, provider, install, manage, version

pulumi policy
Manage policy packs for compliance and governance. Enforce organizational standards.

pulumi policy enable my-policy-pack latest

Keywords: policy, compliance, governance, standards, enforce

pulumi watch
Automatically deploy changes when files are modified. Continuous deployment mode.

pulumi watch

Keywords: watch, automatic, continuous, deployment, files

pulumi cancel
Cancel a currently running update operation. Stop in-progress deployment.

pulumi cancel

Keywords: cancel, stop, abort, update, deployment

pulumi whoami
Display the current logged-in user. Shows Pulumi Cloud identity.

pulumi whoami

Keywords: whoami, user, identity, logged, cloud

pulumi login
Log in to Pulumi Cloud or self-hosted backend. Authenticate for state management.

pulumi login

Keywords: login, authenticate, cloud, backend, state