Skip to content

Bakery resources

Bakery discovers *.bake.json, *.bake.yaml and *.bake.yml recursively in the system directory. Each file contains a list of resource entries. An object instead of a list, or an item without resource, is silently ignored.

[{"resource_module":"notes","resource":{"identifier":"notes","fields":[{"identifier":"name","type":"text"}]}}]

Every entry has resource_<type>: <stable identifier> and resource: { ... }. Optional envelope keys are depends_on, import (false), and policy (sync).

Policies: sync keeps state synchronized; once creates only if absent; detach stops managing manually changed entities (entity types only); sync_testing applies outside production.

depends_on contains a resource expression, for example ${resource_module.notes}. References to computed attributes use ${resource_module.notes.id}. Expressions use ${...} with Bakery functions such as file, jsonFile(path, eval), glob, trimFile/fileWithoutNewlines, env, appEnv, mixin, and capabilityComposable. Files must stay inside the system directory. env(key, default, true) can read instance environment keys only from BREZEL_RECIPE_ENV_ALLOWLIST.

Module layouts has special reference rules: see module layouts. Run plan and apply after validating the resource definition.

Source: app/Bakery/Plan/BakeryResourceFactory.php and resource subclasses.