Skip to content
Latchkey

Pulumi StackReference "unknown stack output" in CI

A stack that reads another stack’s outputs via StackReference could not resolve them - the referenced stack name is wrong, lives in a backend the runner cannot see, or never exported the key being read.

What this error means

pulumi up on the consuming stack fails resolving a StackReference, reporting an unknown stack or an undefined output. It is deterministic: the same reference name and key fail every run until the producer exports the value or the name is corrected.

pulumi output
error: unknown stack 'myorg/network/dev' referenced by StackReference
# or
error: stack 'myorg/network/dev' does not have an output named "vpcId"

Common causes

Wrong reference name or backend

The StackReference name must be the fully qualified org/project/stack, and the runner must be logged into the same backend that holds it. A short name or a different backend resolves to "unknown stack".

Producer never exported the output

The consuming stack reads getOutput("vpcId"), but the producing stack did not export const vpcId = ... (or used a different key), so there is nothing to read.

How to fix it

Reference the fully qualified stack and export the key

Export the value in the producer and reference it by its full name in the consumer.

index.ts
// producer stack
export const vpcId = vpc.id;

// consumer stack
const net = new pulumi.StackReference("myorg/network/dev");
const vpcId = net.getOutput("vpcId");

Confirm the backend and available outputs

  1. Log into the same backend (pulumi login) the referenced stack lives in.
  2. List what the producer exports: pulumi stack output --stack myorg/network/dev.
  3. Match the key name exactly - output keys are case-sensitive.

How to prevent it

  • Always reference stacks by their fully qualified org/project/stack name.
  • Keep producer exports and consumer getOutput keys in sync.
  • Ensure CI logs into the backend that holds every referenced stack.

Frequently asked questions

What causes "StackReference output missing"?
The StackReference name must be the fully qualified org/project/stack, and the runner must be logged into the same backend that holds it. A short name or a different backend resolves to "unknown stack".
How do I fix StackReference output missing?
Export the value in the producer and reference it by its full name in the consumer.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card