Blueprints

The resource graph

How resources reference each other with the $ syntax, and why a blueprint file is a connected system.

Two kinds of reference

Inside a blueprint file you address other values with a small $ syntax, passed as a plain string. There are two forms you'll use most:

SyntaxResolvedUse it for
$.values.<key>When the file runs (eval time)A reusable constant from the values block, such as a project ID.
$.resources.<name>At deploy timeA reference to another resource in the same file. This creates a dependency edge.
$.resources.<name>.idAt deploy timeThe generated ID of another resource, usable as a string once it exists.

Values: constants you reuse

A value is always a string (not an object or array). Define it once in the values block and reference it with $.values.<key> wherever it's needed. The most common use is a project ID drawn from the environment, so the file carries no hard-coded IDs:

Values resolve when the file runs, so they can't be built from things that only exist at deploy time. If you need to compose a string, do it in plain JavaScript at the top of the file and assign the result to a value.

Resource references: edges in the graph

When one resource names another with $.resources.<name>, Blueprints records a dependency: the referenced resource is resolved before the resource that points at it. A robot token that uses a role defined in the same file is a clear example:

You don't order resources yourself. Blueprints reads the references, builds the graph, and arranges the work so each dependency exists before it's needed.

References are validated

Why this matters

The graph is what makes a blueprint file more than a pile of settings. It records how your resources relate (this token uses that role, this webhook watches that dataset) and makes those relationships explicit, reviewable, and reproducible. Change one resource and the connected ones come along with it.

Referencing across stacks

A resource in one stack can hold a read-only reference to a resource in another stack in the same scope. This is an advanced, evolving capability. For the common case of pointing resources at an existing project, define the project ID as a value and supply it from the environment, as shown above.

Was this page helpful?