A variable’s value can include references to other variables. References resolve at deploy time, so the running container sees the final string, not theDocumentation Index
Fetch the complete documentation index at: https://paper.brimble.io/llms.txt
Use this file to discover all available pages before exploring further.
{{...}} syntax.
Two kinds of references exist:
{{shared.NAME}}pulls a value from a shared environment the project inherits from.{{@project-slug.NAME}}pulls a value from another project in the same workspace.
Shared variables
A workspace can have a shared environment, a set of variables defined once and inherited by any project that opts in. When a project inherits from a shared environment, you can reference any of its variables from within a project-level variable using{{shared.NAME}}.
Set up shared variables
- In the dashboard, open the project.
- Go to Environments (the tab next to Environment).
- Edit the active environment and set Inherit from to a shared environment.
| Project variable | Value |
|---|---|
STRIPE_PUBLIC_KEY | {{shared.STRIPE_PUBLIC_KEY}} |
API_URL | https://api.{{shared.BASE_DOMAIN}} |
{{shared.MISSING}} stays literal). The deployment logs a warning so you can spot it.
Cross-project references
You can pull a variable from another project in the same workspace by prefixing the slug with@:
| Project variable | Value | Resolves to |
|---|---|---|
DATABASE_URL | {{@acme-pg-prod.CONNECTION_STRING}} | The CONNECTION_STRING variable from the acme-pg-prod project. |
INTERNAL_API | https://{{@api-gateway.HOSTNAME}}/v1 | The hostname from the api-gateway project. |
- Same workspace only. A team project can only reference other team projects (under the same team). A personal project can only reference your other personal projects. There’s no cross-workspace reference.
- Slug-based. The
@prefix is the project’s slug (the lowercase, dash-separated form of its name). Brimble normalizes the slug before lookup, so casing doesn’t matter. - One-way and resolved at deploy time. If you change the source variable, the consuming project doesn’t redeploy automatically, its env stays at the previous value until it redeploys.
Combining and chaining references
References can be embedded in a longer string and can chain, a referenced value that itself contains a reference will resolve, too.ENDPOINT and inherits from the shared environment gives:
A references B and B references A, both resolve to their last-known string instead of looping.
Limits
- References don’t escape
{{...}}, there’s no syntax for “literal{{shared.X}}in a value.” If your real value contains those braces, refactor or store the value in a way that doesn’t need them at deploy time. - References resolve every deploy. The resolver caches per request, so a deploy with many references is fast, but it’s not free. Don’t fan out into hundreds of references unless you need to.
- The resolver uses your secret store as the source of truth, references read live values, not snapshots.
Next steps
- Manage environment variables, adding, editing, and inheriting variables.
- Environments, the inheritance model.