Defining Variables
Nomatron is in early access. Some advanced workflows may not be covered in the public docs.
Writing the template file is only half of the job. The other half is defining the variables the template expects Nomatron to resolve.
What A Variable Needs
Each variable definition should answer four questions:
- what is the key?
- where does it belong?
- what type is it?
- is it sensitive?
In Nomatron, the important properties are:
keydescriptionvalue_typesensitivity- an optional default value
- any environment-specific overrides
Choose The Right Scope
Choose the scope based on who should own the value and how reusable it should be.
Use:
globalfor platform-wide values shared everywhere;organizationfor tenant-level values;appfor values shared across jobs in one app; andapp jobfor values that only apply to one deployable job.
Examples:
| Variable | Good scope | Why |
|---|---|---|
GLOBAL_REGION | global | shared platform setting |
ORG_OWNER | organization | specific to one tenant |
APP_IMAGE_REPOSITORY | app | shared across one service |
APP_JOB_COUNT | app job | specific to one deployable workload |
Choose The Right Type
Nomatron supports these value types:
stringnumberbooljson
Pick the type that matches how the template uses the value.
Examples:
| Variable | Good type | Why |
|---|---|---|
IMAGE_TAG | string | textual container tag |
COUNT | number | numeric replica count |
ENABLE_CANARY | bool | true/false behavior |
DATACENTERS | json | structured list or object |
Choose The Right Sensitivity
Use:
normalfor ordinary values; andsensitivefor secrets or values that should be masked in preview-style render flows.
Typical sensitive examples:
- API tokens
- passwords
- DSNs containing credentials
- private keys
Typical non-sensitive examples:
- image tags
- CPU and memory settings
- region names
- datacenter lists
Defaults And Environment Overrides
Nomatron resolves values in this pattern:
- environment-specific override, if one exists for the render target;
- default variable value, if one exists; then
- unresolved/missing, if neither exists.
That makes a good authoring pattern:
- set a sensible default for values that usually stay the same; and
- add environment-specific overrides only where behavior must differ.
Example:
| Variable | Default | Dev override | Prod override |
|---|---|---|---|
IMAGE_TAG | latest | dev-latest | v1.2.3 |
APP_JOB_COUNT | 1 | 1 | 3 |
Example Variable Set
For a simple service template, you might define:
APP_IMAGE_REPOSITORY string normal
IMAGE_TAG string normal
APP_JOB_COUNT number normal
APP_JOB_CPU number normal
APP_JOB_MEMORY number normal
DATABASE_URL string sensitiveThen populate:
- default values for the common baseline; and
- environment overrides for anything that must differ across
dev,staging, andprod.
Managing Variables
You can manage variables through:
- the Nomatron GUI;
- the CLI in Variables ;
- the API;
- or Terraform in Manage Nomatron with Terraform .
Common Mistakes
The most common variable-definition mistakes are:
- using the wrong type, such as
stringwhere the template expects a number; - storing secrets as
normalinstead ofsensitive; - creating the variable in the wrong scope;
- forgetting a default when no environment override exists; and
- changing the key in Nomatron without changing the template token.