Stack references & multi-project
Wire networking to app stacks.
Large infrastructure is split across stacks — a networking stack, a data stack, an app stack — so blast radius and ownership stay small. A StackReference lets one stack read another’s outputs: the app stack reads the VPC ID and subnet IDs the networking stack exported, without duplicating them or hard-coding IDs. It is the typed, first-class way to wire stacks together.
// producer: export what other stacks may consumeexport const vpcId = vpc.id;export const privateSubnetIds = privateSubnets.map(s => s.id);
// consumer: read another stack’s outputs by nameconst net = new pulumi.StackReference("acme/networking/prod");const vpcId = net.getOutput("vpcId");const subnets = net.getOutput("privateSubnetIds");new aws.lb.LoadBalancer("app-lb", { subnets: subnets as pulumi.Output<string[]> });
Boundaries and ownership
Splitting by stack maps naturally to team ownership and change cadence: the network team owns the networking stack and its exported contract, app teams consume it. Because a StackReference only reads outputs, the consuming stack cannot accidentally modify the producer — the coupling is a read-only, versioned interface, which is exactly what you want between teams.