Pulumi Architecture Diagram: Visualize Your Infrastructure as Code (2026)
How to create architecture diagrams for Pulumi infrastructure-as-code. Covers Pulumi stacks, components, resource graphs, multi-cloud setups, and how to keep diagrams in sync with your Pulumi programs.
Pulumi lets you define cloud infrastructure using real programming languages — TypeScript, Python, Go, C#, Java — rather than domain-specific configuration files like Terraform's HCL. That expressiveness is a superpower: you get loops, conditionals, functions, and package management for your infrastructure. The challenge is that the same expressiveness that makes Pulumi programs powerful makes them harder to visualize. Unlike a Terraform module where the resources are explicitly listed, a Pulumi program can create resources conditionally, iteratively, or through abstracted component resources, making the final cloud topology non-obvious from reading the code.
Architecture diagrams are the solution. A Pulumi architecture diagram shows the cloud resources your program provisions, their relationships, and how they map to Pulumi's organizational constructs — stacks, projects, and component resources. This guide covers how to create them, what to include, and how to keep them current as your infrastructure evolves.
Pulumi concepts that shape your diagram
Before diagramming, understand the Pulumi hierarchy that structures your infrastructure:
- Organization — the top-level account in Pulumi Cloud, containing all projects and teams
- Project — a single codebase (a
Pulumi.yamlfile) that defines one or more stacks - Stack — a deployed instance of a project, typically one per environment (dev, staging, prod) or one per region in multi-region deployments. Each stack has its own state and configuration values
- Resource — a single cloud resource (an S3 bucket, an EC2 instance, a Kubernetes deployment) declared in the program
- Component Resource — a custom class that groups multiple resources into a reusable logical unit. Component resources are the Pulumi equivalent of Terraform modules
- Stack References — cross-stack dependencies that allow one stack to read outputs from another, enabling modular multi-stack architectures
A good Pulumi architecture diagram shows the cloud resources and their logical grouping into components, not the Pulumi SDK calls themselves. The diagram communicates what gets provisioned, not how the code provisions it.
What to include in a Pulumi architecture diagram
The right scope depends on your audience. For infrastructure engineers, include resource-level detail. For a technical overview shared with the broader team, group resources into logical tiers. A complete Pulumi architecture diagram typically covers:
- Cloud resources by tier — networking (VPCs, subnets, security groups), compute (EC2, Lambda, ECS/Fargate, GKE), storage (S3, RDS, DynamoDB), and the connections between them
- Component resource boundaries — show which resources are grouped into a component resource, with the component name as a labeled boundary. This makes the diagram match the code's abstraction level
- Stack boundaries and stack references — if you use multiple stacks (network stack, app stack, data stack), show each as a distinct boundary with arrows representing stack reference dependencies
- Provider accounts — for multi-cloud Pulumi programs that deploy to AWS, GCP, and Azure simultaneously, label each cloud boundary clearly
- External dependencies — SaaS APIs, external databases, CDN providers, and DNS registrars that your infrastructure interacts with but doesn't manage
- Pulumi Automation API workflows — if you use the Pulumi Automation API to programmatically manage stacks (CI/CD, self-service portals), show the automation layer above the stacks it manages
Prompt templates for Pulumi architecture diagrams
Single-stack application
Multi-stack architecture with stack references
Multi-cloud Pulumi program
Pulumi vs Terraform: diagramming differences
If you're migrating from Terraform or maintaining both, understanding the diagramming differences helps:
- Modules vs. Component Resources — Terraform modules and Pulumi component resources both group related resources, but component resources are real classes that can be shared via npm/PyPI packages. Diagrams should label component resources by their package name if they come from a shared component library (e.g.,
@myorg/aws-rds-component) - Workspaces vs. Stacks — Terraform workspaces and Pulumi stacks are conceptually similar but Pulumi stacks are more first-class. In Pulumi, it's common to have separate projects per major infrastructure domain (not just separate workspaces), so multi-project architectures are more common in Pulumi diagrams
- Dynamic resources — Pulumi programs can create resources in loops, so a diagram might show “N replica resources” rather than enumerating each one. Use a multiplicity annotation (e.g., EC2 instance × 3) rather than drawing each instance separately
- Pulumi Automation API — Terraform has no equivalent to the Automation API. If your platform team uses it to manage self-service infrastructure, the diagram should show the orchestration layer (your internal portal or CI system) managing stacks via the API
For the Terraform side, see the Terraform architecture diagram guide.
Keeping Pulumi diagrams current
The same challenge that makes Terraform diagrams go stale applies to Pulumi: infrastructure code changes faster than diagrams. Practical approaches:
- Add a
README.mdto each Pulumi project with an embedded architecture description. When the program changes, update the description and regenerate the diagram - Use
pulumi stack exportto get the full state file, then describe the resulting resource graph to an AI architecture diagram generator. The state file is the ground truth for what's deployed - Tag resources with a
diagram:componenttag that matches your component resource class names. This makes it easier to reconstruct the intended groupings from a state export - Add diagram generation to your PR review process for infrastructure changes — generate an updated diagram and include it in the PR description so reviewers can see the before/after topology change
Frequently asked questions about Pulumi architecture diagrams
Does Pulumi have a built-in diagram generator?
Pulumi does not have a native diagram generator, though pulumi preview --diff and the Pulumi Cloud console show resource dependency graphs. For comprehensive architecture diagrams showing tiers, data flows, and component groupings beyond the raw resource graph, use an AI diagram generator with a plain English description of your Pulumi program's resources and structure.
What is a Pulumi component resource and how do I diagram it?
A component resource is a custom Pulumi class that groups multiple child resources into a reusable logical unit. In a diagram, represent a component resource as a labeled boundary box containing its child resources. The component class name becomes the boundary label. If the component comes from a published Pulumi package (e.g., the Pulumi AWS static website component), note the package name in the label.
How do I show Pulumi stack references in an architecture diagram?
Draw each stack as a distinct boundary box. Stack references — where one stack reads outputs from another — become directed arrows between stack boundaries, labeled with the output being consumed (e.g., “VPC ID,” “RDS endpoint”). The arrow direction follows data flow: from the stack that exports the value to the stack that consumes it via StackReference.
Related guides: Terraform architecture diagram, cloud architecture diagram best practices, Kubernetes architecture diagram examples, and GitOps architecture diagram.
Ready to try it yourself?
Start Creating - Free