Skip to content

Cross-Stack References

Cross-stack references let one stack use values produced by another stack in the same app. With an app-level hybrid plan, Netherframe uses the reference to order operations across those stacks.

Why They Exist

Without cross-stack references, teams are often pushed into one of two bad options:

  • put too much infrastructure into one giant stack
  • copy values manually between stacks

Cross-stack references keep stack boundaries useful without losing composition.

Typical Examples

  • an app stack needs a VPC ID from a network stack
  • a service stack needs a bucket ID from a storage stack
  • a compute stack needs a subnet ID from a shared platform stack

Reference Flow Diagram

flowchart LR
    A[Network stack] -->|exports VPC ID| B[App stack]
    C[Storage stack] -->|exports bucket ID| B
    D[Platform stack] -->|exports subnet ID| E[Compute stack]

What To Be Careful About

Cross-stack references are powerful, but too many of them can make a system harder to reason about.

Use them when the dependency is real and stable. Avoid them when:

  • the stacks are so tightly coupled that they should really be one stack
  • the dependency is temporary and operationally awkward
  • the value could be represented more cleanly as environment policy or input

Relationship To Stack Dependencies

A stack dependency is the coarse ordering rule. A cross-stack reference is the value-level dependency inside that relationship.

In many cases you will care about both:

  • stack ordering for deployment flow
  • specific values flowing from one stack to another

Ordering vs Value Flow

flowchart TD
    A[Stack dependency] --> B[Deployment ordering]
    C[Cross-stack reference] --> D[Specific value flow]
    B --> E[Network before app]
    D --> F[VPC ID from network to app]

Relationship To Phases

Cross-stack references are not automatically a problem. They become harder when they participate in cycles or other complex dependency graphs. That is where phase planning becomes relevant.