Pulumi Reference
Free reference guide: Pulumi Reference
About Pulumi Reference
The Pulumi Reference is a searchable cheat sheet for Pulumi infrastructure-as-code (IaC), covering the complete workflow from project creation with pulumi new to deployment with pulumi up, preview, and destroy. It includes stack management for multi-environment separation, resource creation for AWS services like S3 and EC2, ComponentResource for reusable infrastructure modules, Output/apply patterns for asynchronous value handling, and secret management with encrypted configuration.
Designed for DevOps engineers, cloud architects, SRE teams, and platform engineers, this reference covers real TypeScript code examples for Pulumi resources, stack references for cross-stack data sharing, dynamic providers for custom resource lifecycle management, and provider configuration for multi-region deployments. All entries are organized into Project, Stack, Resources, Outputs, Secrets, and Config categories.
Every entry includes copy-ready CLI commands or TypeScript code snippets with practical usage patterns. Whether you are managing AWS, Azure, GCP, or Kubernetes infrastructure with Pulumi, this cheat sheet provides the commands and code patterns you need for daily IaC operations.
Key Features
- Complete Pulumi CLI reference — pulumi new, preview, up, destroy with all essential flags and options
- Stack management commands for dev/staging/production environment separation and state export/import
- AWS resource creation examples for S3 buckets and EC2 instances with tags, VPC, and security groups
- ComponentResource pattern for building reusable infrastructure modules with parent-child relationships
- Output<T> and apply() patterns for handling asynchronous resource values and string interpolation
- Secret management with pulumi config set --secret, pulumi.secret(), and KMS/Vault providers
- Stack References for cross-stack output sharing between network, compute, and application stacks
- Provider Configuration for multi-region deployments with custom AWS/Azure/GCP provider instances
Frequently Asked Questions
What is Pulumi and how does it differ from Terraform?
Pulumi is an infrastructure-as-code platform that lets you define cloud resources using general-purpose programming languages like TypeScript, Python, Go, and C# instead of a domain-specific language. Unlike Terraform's HCL, Pulumi uses real code with loops, conditionals, functions, and classes, making it easier to create reusable abstractions and integrate with existing development workflows.
What Pulumi commands does this reference cover?
This reference covers the core CLI commands: pulumi new for project scaffolding, pulumi preview for dry-run change visualization, pulumi up for deployment, pulumi destroy for resource teardown, and stack management commands including pulumi stack init, select, output, and export/import for state management.
How does Pulumi handle secrets and sensitive configuration?
Pulumi encrypts secrets using pulumi config set --secret, which stores values encrypted in the stack configuration file. In code, config.requireSecret() returns an Output<string> that is never displayed in logs or state output. Pulumi supports pluggable secret providers including AWS KMS, Azure Key Vault, GCP KMS, and HashiCorp Vault for enterprise-grade encryption.
What is a ComponentResource in Pulumi?
A ComponentResource is a class that groups multiple related resources into a single reusable component. For example, a VpcComponent might create a VPC, subnets, route tables, and security groups as a single unit. Child resources are linked via the parent option, creating a logical tree in the Pulumi state that makes complex infrastructure easier to manage and reason about.
How do Pulumi Outputs and apply() work?
Pulumi Output<T> represents a value that will be known only after deployment (like an IP address or ARN). The apply() method transforms Output values, similar to Promise.then(). Use pulumi.all() to combine multiple Outputs, and pulumi.interpolate for string templates. Outputs ensure that resource dependencies are automatically tracked and resolved in the correct order.
How does Pulumi manage multiple environments?
Pulumi uses stacks to separate environments. Create stacks with pulumi stack init dev/staging/production, each with its own configuration file (Pulumi.dev.yaml). Stack References allow one stack to read outputs from another, enabling patterns like a shared network stack referenced by multiple application stacks. Each stack maintains independent state.
What Resource Options are available in Pulumi?
Key resource options include: protect (prevents accidental deletion), dependsOn (explicit dependency ordering), parent (logical grouping under ComponentResource), provider (custom provider for multi-region), ignoreChanges (skip specific property drift detection), and deleteBeforeReplace (force recreation order). These options are passed as the third argument to resource constructors.
Is this Pulumi reference free to use?
Yes, this Pulumi reference is completely free with no usage limits, no account required, and no software installation needed. All content is rendered client-side in your browser. It serves as a practical daily companion for DevOps engineers working with Pulumi infrastructure-as-code.