What Pulumi Does
- Multi-language IaC — TS, Python, Go, C#, Java, YAML
- Multi-cloud — AWS, Azure, GCP, Kubernetes, 140+ providers
- State management — Pulumi Cloud (SaaS), self-hosted, S3, Azure Blob, local file
- Policy as Code — CrossGuard policies in TS/Python
- Secrets — encrypted state and config
- Component Resources — package reusable abstractions
- Automation API — programmatically drive Pulumi
- Import — bring existing cloud resources under Pulumi
- ESC — environments, secrets, configuration service
Architecture
Your program is a regular TS/Python/Go app using Pulumi SDK. At runtime it builds a resource graph. Pulumi engine computes a plan against current state and executes changes via provider plugins (which wrap Terraform providers or native cloud SDKs).
Self-Hosting
Pulumi CLI is open source. State backend options include Pulumi Cloud (managed SaaS) or self-hosted backends (S3, Azure Blob, GCS, local file). For enterprise: Pulumi Cloud Self-Hosted.
Key Features
- Real programming languages
- 140+ cloud providers
- Policy as Code (CrossGuard)
- Component resources for abstraction
- Secrets encryption
- Import existing resources
- Automation API
- Stack references across projects
- Easy testing via unit tests
- Pulumi ESC for environment/secrets management
Comparison
| Tool | Language | State | Provider Count |
|---|---|---|---|
| Pulumi | TS/Py/Go/C# | Managed or self | 140+ |
| Terraform | HCL | tfstate file | 3000+ |
| OpenTofu | HCL (Terraform fork) | tfstate | Same as TF |
| CDK (AWS) | TS/Py/Java/C# | CloudFormation | AWS only |
| Cdktf | TS/Py/Go/C# | tfstate | TF-compatible |
| CloudFormation | YAML/JSON | AWS | AWS only |
常见问题 FAQ
Q: Pulumi vs Terraform? A: Terraform HCL 是 DSL(上手快,但表达力受限);Pulumi 用真实编程语言(复杂逻辑、循环、类、测试更自然)。Terraform 生态更大、Pulumi 开发体验更好。
Q: 可以用 TS 写 K8s 吗?
A: 可以。@pulumi/kubernetes 提供全部 K8s 资源类型,强类型自动补全。比 YAML 宜人。
Q: state 放哪? A: 默认推荐 Pulumi Cloud(免费 tier 够小团队用)。要完全私有则用 S3/Azure Blob/GCS + encryption-provider。
来源与致谢 Sources
- Docs: https://www.pulumi.com/docs
- GitHub: https://github.com/pulumi/pulumi
- License: Apache 2.0