Resources and deployments#
Business Language includes runtime and infrastructure declarations. Use these declarations to describe runtime shape and deployment wiring, not to encode tenant policy.
Wiring model#
Use program declarations for runtime topology: hosts expose entry points, stores describe runtime storage needs, and provider profiles bind abstract provider names to concrete provider implementations.
Use resource declarations for deployable infrastructure. Resource names and references are one or more identifiers, such as web app, database primary, or network private. Statements like host on, connect to, and on link resources by reference.
Use deployment declarations to select a provider profile and region, include resources with use, and publish deployment outputs. Deployment bodies may also contain variable and expression statements for deployment-time calculations.
Fields such as profile, name, version, env, secret, engine, admin login, admin password secret, provider profile, region, and output values are expressions. Resource links use resource references instead of string values.
Programs, resources, and deployments may have leading annotations and an optional access modifier.
@runtime
public program Runtime {
}
@managed
internal resource web app {
runtime node version "20";
}
@release
public deployment production() {
provider profile "contabo";
}Programs#
program Runtime {
host http api {
bind: VendorApi;
startup {
ensure Database.migrate "latest";
}
}
store main {
provider: "postgres";
}
provider_profile production {
bind Cloud.Postgres -> Providers.Postgres;
region: "eu-central-1";
}
}Programs can contain hosts, stores, and provider profiles. host, store, and provider_profile declarations are valid only inside a program body.
Host and store bodies accept named properties, and provider profiles can combine provider bindings with the same nested property shape.
Hosts#
Host kinds include console, http, and worker.
program JobsRuntime {
host worker jobs {
bind: JobProcessor;
startup {
ensure Jobs.start;
}
}
}Startup steps use ensure followed by a qualified invocation name and optional qualified, string, integer, or boolean arguments. They are not function-call syntax.
startup {
ensure Database.migrate "latest" true 3;
}Resources#
resource web app {
profile "prod";
name "docs-web";
public;
host on cluster main;
runtime node version "20";
env PORT = 8080;
secret DATABASE_URL = "docs-db-url";
connect to database docs;
engine "container";
admin login "admin";
admin password secret "docs-admin-password";
on network private;
}Resource references are one or more identifiers, so web app, database postgres, and queue jobs are valid resource names.
env and secret names are unquoted identifiers; their assigned values are expressions. runtime accepts one runtime identifier, with an optional version expression. Resource links such as host on, connect to, and on use unquoted resource references.
resource worker jobs {
runtime node version "20";
env PORT = 8080;
secret DATABASE_URL = "docs-db-url";
connect to database primary;
}Deployments#
deployment release(env: string) {
provider profile "contabo";
region "de";
use web app;
output endpoint = "https://docs.nezam.ai";
}Deployments support parameters, provider profile, region, resource usage, outputs, variable statements, and expression statements.
Deployment declarations always include parentheses. Use () when there are no deployment parameters.
deployment release() {
provider profile "contabo";
region "de";
use web app;
output endpoint = "https://docs.nezam.ai";
}A deployment site normally ties a runtime program to concrete resources and selected deployment resources.
program Runtime {
host http api {
bind: VendorApi;
}
store main {
provider: "postgres";
}
}
resource web app {
host on cluster main;
runtime node version "20";
connect to database primary;
}
resource database primary {
engine "postgres";
admin password secret "db-admin-password";
}
deployment production() {
provider profile "contabo";
region "de";
use web app;
use database primary;
output web_url = "https://erp.example.com";
}Configuration declarations#
The dedicated configuration declaration is intentionally small:
config Sales;
config Sales {
}Use tables for runtime policy configuration that varies by tenant or process.