Implement Pulumi stack references to share infrastructure outputs between a network stack and an application stack in separate Pulumi projects

domain: pulumi.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. In the network stack, declare outputs for the VPC ID, subnet IDs, and security group IDs using the pulumi.export function at the end of the stack program
  2. In the application stack program, instantiate a StackReference object pointing to the fully qualified network stack name using the organization/project/stack format
  3. Retrieve the exported values from the stack reference using the GetOutput or RequireOutput methods, noting that these return Output values that must be used in Pulumi's async output system rather than unwrapped synchronously
  4. Pass the retrieved outputs as arguments to the application resources such as ECS services, RDS instances, or EC2 security group rules that depend on the network infrastructure
  5. Run pulumi up on the application stack and confirm the referenced outputs from the network stack are correctly resolved in the plan output before confirming the update

Known gotchas

Related routes

Implement a Pulumi Stack Reference pattern where an infrastructure stack exports VPC and subnet IDs consumed by an application stack in a different project
Pulumi · 6 steps · unrated
Configure Pulumi to provision infrastructure using Python and manage stack secrets with the passphrase secrets provider instead of Pulumi Cloud
www.pulumi.com · 6 steps · unrated
Use the Pulumi Automation API in Python to programmatically create and destroy ephemeral stacks with inline programs for integration test environments
pulumi.com · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans