Output
Creating Structured Data Artifacts from Your Graph
Output files, located in data/output/, are the final step in the processing pipeline. They allow you to query the fully constructed graph and generate new, structured data resources. This is ideal for creating artifacts like compliance summaries, service catalogs, or inputs for other automation systems.
Similar to models, an [[output]] rule iterates over each matching origin_resource and creates one new resource per match. Unlike models, which enrich the graph with structural components, outputs are designed to generate final, structured data artifacts from the fully built graph. This can include downloadable files like reports or manifests.
File Header & Rule Structure
| Key | Scope | Mandatory | Description |
|---|---|---|---|
origin_resource |
Top Level | Yes | The resource type to iterate over (e.g., application). |
(any name) |
Top Level | No | Custom data for use in templates, such as { "json!" = "path/to/file.json" }. |
[[output]] |
Top Level | Yes | An array of rules, each defining an aggregate output resource to generate. |
Each [[output]] block defines a rule for creating a single aggregate resource.
| Key | Scope | Mandatory | Description |
|---|---|---|---|
resource_type |
[[output]] |
Yes | The type for the new output resource created for each matching origin_resource. |
name |
[[output]] |
Yes | A template for the primary key (name property) of the new output resource. It is rendered once for each matching origin_resource. |
match_on |
[[output]] |
No | An array of filter objects. The rule is applied only if the origin_resource matches all conditions. |
filename |
[[output]] |
No | A template for the filename when the output is downloaded via the API. If present along with mimetype, this enables a download endpoint for the resource. |
mimetype |
[[output]] |
No | The MIME type for the output content (e.g., application/json, text/csv). If present along with filename, this enables a download endpoint. |
template |
[[output]] |
Conditional | A multiline string template that renders a JSON object. This rendered JSON becomes the set of properties for the new output resource. It supports Tera for advanced object creation. Mutually exclusive with jsonnet. |
jsonnet |
[[output]] |
Conditional | A Jsonnet program string that evaluates to a JSON object, which becomes the set of properties for the new resource. This allows for complex logic, functions, and imports. Mutually exclusive with template. |
One of template or jsonnet is required.