Back to blog

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.

R
Ryan·Senior AI Engineer
·

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.yaml file) 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

"Pulumi TypeScript program deploying a SaaS application on AWS. One stack per environment (dev, staging, prod). Resources: VPC with public and private subnets across 2 AZs; Application Load Balancer in the public subnet; ECS Fargate cluster with 2 services (API service and background worker service) in private subnets; RDS PostgreSQL in a dedicated database subnet; ElastiCache Redis for session storage; S3 bucket for file uploads; CloudFront CDN fronting the ALB and S3. Component resources: VpcComponent (VPC + subnets + NAT gateway), AppComponent (ECS cluster + both services + ALB), DataComponent (RDS + Redis). Stack outputs: ALB DNS name, CloudFront distribution URL, RDS connection endpoint. Draw the infrastructure architecture showing resources, component groupings, and data flows."

Multi-stack architecture with stack references

"Pulumi program split across 3 stacks with stack references. Stack 1 (Network): VPC, subnets (public/private/database tiers), NAT gateways, VPC endpoints for S3 and ECR. Exports: VPC ID, subnet IDs, security group IDs. Stack 2 (Data): RDS Aurora PostgreSQL cluster, ElastiCache Redis cluster, S3 buckets for uploads and backups. Reads VPC details from Stack 1 via stack reference. Exports: database connection strings, Redis endpoint, S3 bucket ARNs. Stack 3 (App): EKS cluster, node groups, application deployments via Helm. Reads from both Stack 1 and Stack 2. Exports: EKS cluster endpoint, application URLs. Show stack boundaries, stack reference arrows, and the cloud resources within each stack."

Multi-cloud Pulumi program

"Pulumi Python program deploying across AWS and GCP using multiple providers. AWS resources: Route53 for DNS, CloudFront CDN, S3 for static assets, API Gateway + Lambda for the API layer, RDS for relational data. GCP resources: BigQuery for analytics warehouse, Cloud Storage for raw data lake, Pub/Sub for event streaming from AWS Lambda to GCP. GCP Dataflow pipeline reading from Pub/Sub and writing to BigQuery. Architecture shows both cloud environments as distinct boundaries, the cross-cloud data flow (Lambda → Pub/Sub), and the internal resources within each cloud. External: users hit CloudFront; BI tools connect to BigQuery."

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.md to each Pulumi project with an embedded architecture description. When the program changes, update the description and regenerate the diagram
  • Use pulumi stack export to 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:component tag 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