Parameter set (kind: parameterset)
One named set of plain values: the instance data of a spoke, a hub, a customer or a tenant. The values a whole family of documents differs by (a name, a sequence number, a subscription ID) live in one place, so the documents that use them can share one base.
Status: deployments, environments and tenants. Each names sets in
meta.params, and${param:<role>.<key>}works in any field of itsspecexceptextendsandpartial, reference fields included (tenant,environments,providers[].provider). Environments and tenants are resolved when the solution loads, before deployments: see environment and tenant. The exported schemas of the three kinds accept a${param:}token in the same fields, so the YAML editor does not underline one.
For a full, worked solution (two hubs, two spokes, a customer project), see How To: Write one deployment base for many spokes; for tenants and environments, How To: Give every customer a tenant and an environment from shared bases. How it works inside: the design. The decision is ADR-0061.
Schema
spec.values— required: a map of any YAML (scalars, lists and nested maps). Its shape is the solution’s own; strata does not prescribe keys. An empty map is validmeta.name— the name a document will use inmeta.paramsmeta.labels— optional, as on any kind. A label such asrole: spokeis only for attributeconfig selectors: a set does not know its role. The document that names the set gives the role
A parameter set has no extends, no partial and no params: it builds on nothing.
Values are plain
No ${...} token may appear in spec.values, in a key or in a value: not ${var:}, not
${secret:}, not ${param:}. A parameter set depends on nothing, so it can be loaded first, and a
value can never insert a token into the document that reads it. A token in a parameter set is a
load error that names every key holding one:
spec.values: a parameter set holds plain values, but values.name holds a ${...} token. Move the
token into the document that reads the value, or write $${...} for the literal text.
The usual escape works: $${TOKEN} is the literal text ${TOKEN}, as in any other document (for
example a Helm chart’s own substitution syntax).
A parameter set is plain text in git, so it must not hold secrets. Keep ${secret:} in the spec
of the document that needs the secret. A ${param:} token in an environment’s
secrets[].value is a load error, so a secret can never be filled in from a parameter set.
Example
apiVersion: strata.huybrechts.xyz/v2
kind: parameterset
meta:
name: spoke-acme-001
labels: { role: spoke } # optional: for attributeconfig selectors
spec:
values:
name: acme-001
hub: hub01
tenant: acme
code: acme
seq: "001"
subscription_id: 00000000-0000-0000-0000-000000000001
network:
cidr: 10.1.0.0/16
customers: [acmep01, acmep02]
Quote values YAML would otherwise read as another type: seq: "001" stays the text 001, while
seq: 001 is the number 1.
Using a parameter set
A deployment names sets per role in meta.params, and any document of its extends chain
reads them with ${param:<role>.<key>}. The role is chosen where the set is used, so a base reads
${param:spoke.name} whichever spoke a leaf names:
# the base: shared by every spoke
kind: deployment
meta:
name: spoke_deployment_base
params: { hub: hub-defaults } # optional: defaults, like a chart's values.yaml
spec:
partial: true
workspace: spoke
environments: [prd]
properties:
subscription_name: sub-${param:spoke.name}
provider_region: ${param:hub.region}
customers: ${param:spoke.customers} # the whole value: the list is inserted as a list
---
# a leaf: one per spoke
kind: deployment
meta:
name: spoke-acme-001
params: { spoke: spoke-acme-001 } # or a list per role, merged in order
spec:
extends: spoke_deployment_base
Merging. Every document of the chain may name sets. Per role they merge root first, then down the chain, then the leaf’s, later winning: maps merge per key, lists and scalars are replaced. A base’s sets are defaults; the leaf’s override them.
Whole value or embedded. A token that is the entire value is replaced by the value with its type (a list, a map, a number). A token inside a longer string needs a single value;
trueandfalseare written as YAML writes them.${param:spoke}alone is the whole map of the role. Nested keys and named list items use dots, as${value:}does:${param:spoke.network.cidr}.Once, at load. Values are substituted when the chain is resolved, before anything runs. Run-time tokens (
${var:x},${secret:x}) are left for run time, and$${param:x}stays the literal text${param:x}.A
partial: truebase may hold tokens no value fills yet; only a deployable deployment must resolve every token of its chain.
Templates are validated per deployment
A deployment whose spec holds a ${param:} token is a template, base or leaf. strata
checks its meta, its extends and partial, and the syntax of its tokens when it loads it;
the rest of its spec is checked once per deployable deployment whose chain it is in, after the
values are filled in. So hub-${param:spoke.hub}-env is checked as hub-hub01-env for one spoke
and as hub-hub02-env for the next, and a value that does not fit is reported for the deployment
it was resolved for.
strata deploy listshows a template base as written, tokens and all, and every deployment resolved.A command run on a template base (
deploy run,build run, …) stops with an error saying it is a partial base that reads parameter sets: only a deployment built on it can run.${param:}is never allowed inmeta,spec.extendsorspec.partial: names, parameter sets and chains stay fixed, so strata knows every chain before it reads a value.In a YAML flow list (
[a, b]) or map ({ k: v }), quote a value that holds a token:environments: [solution-env, 'hub-${param:spoke.hub}-env']. In block style no quotes are needed.
Names follow the values: meta.name_rule
A deployment’s meta.name is never filled in from a parameter set: names stay plain text, so
every tool that finds a deployment by name keeps working. A base can still keep names from
drifting away from their values with meta.name_rule:
kind: deployment
meta:
name: bootstrap_deployment_base
name_rule: bootstrap-${param:spoke.name}
spec:
partial: true
# ...
Every deployable deployment built on this base, at any depth, must then be named as the rule
says once its values are filled in: the leaf that names spoke-acme-001 (name: acme-001) must
be bootstrap-acme-001. Any other name is a name_rule_mismatch on the leaf, with both names:
Deployment 'bootstrap-acme' must be named 'bootstrap-acme-001' by the name_rule of
'bootstrap_deployment_base' ('bootstrap-${param:spoke.name}').
Any document of the chain may have a rule, the leaf included; each one applies.
A rule holds only
${param:}tokens: run-time tokens have no value when names are checked.A partial base is not held to a rule; only the deployments that can run are.
Validation
A
${...}token in a key or value ofspec.valuesis a load error (value_error)Two parameter sets with the same name are a
duplicate_documenterror, as for every kindA name in
meta.paramsthat is no parameter set is anunknown_referenceA
${param:}whose key the chain’s sets do not hold, or whose role no document of the chain names, isparam_missing. It is reported on the document that holds the token, for each deployment it was resolved for:base spec.properties.envs[1]: ${param:spoke.hub} not found in spoke: [spoke-acme-001] (for spoke-acme-001)A list or map inside a longer string is
param_not_scalarA filled-in value the field does not accept (a tenant name with a space) is reported on the template, for the deployment:
base spec.tenant: invalid after ${param:} substitution: ... (for initech), with the model’s own code (string_pattern_mismatch, …)A reference that names no document once filled in is an
unknown_referenceon the template’s own field, saying which values made it, for the deployment:base spec.environments[1]: unknown environment 'hub-hub02-env'. Available: [...], from 'hub-${param:spoke.hub}-env': spoke.hub = 'hub02' (spoke-initech) (for initech). A rejected value says the same. A name a template writes literally (workspace: mian) is reported once, on the template, not once per deploymentA malformed token in a template (
${param:}) is a load errorA deployable deployment whose name differs from a
name_ruleof its chain isname_rule_mismatch; a rule that reads a missing key isparam_missingon the rule’s document; any token other than${param:}in a rule is a load errorThe shape of a set’s values, and what a deployment, environment or tenant receives once its sets are merged, are checked with attributeconfig (
block: valuesandblock: params), when a solution declares one. Without it, a missing key is stillparam_missing, and a filled-in value is still checked against the field it lands inA value no document reads is reported as information (
param_unused), never as an error or warning, sostrata validate --strictstill passes: a set may hold more than any one deployment needs, like a Helm values file. A top-level key counts as read when some deployment whose chain names the set under a role reads${param:<role>.<key>...}, or any document reads${value:parameterset.<name>.spec.values.<key>...};${param:<role>}alone reads every key. A set nothing names or reads is reported once${param:}inmeta,spec.extendsorspec.partialis a load errorIn an environment or tenant, the same findings are reported when the solution loads, on the document that holds the token, for the environment or tenant it was resolved for
A
${param:}in a document of another kind (a workspace, a module, …) is not substituted, and the token check reports it as amalformed_value_token
Seeing the result
strata render deployment|environment|tenant NAME shows a document as strata uses it, field by
field: the document that wrote each value, and for a value filled in from a parameter set, the
text as written and the role, key and set it read. -o json gives the same as data. Secret values
are always masked. A partial: true base is not rendered; render a document built on it.
Notes
Where parameter sets live is up to the solution: strata finds documents by
kindandmeta.name, never by folder. Keeping a spoke’s set next to the documents that use it reads well.${value:parameterset.<name>.spec.values.<key>}also reads a set, from any document: raw and by name, with no role, no merge and no defaults, resolved once per solution. Use it for values every deployment shares (a constants set read by an environment or a workspace). In a deployment, use${param:}: a base that names one set serves only that instance, and does not see the defaults and overrides of its chain. Either way, a value read counts forparam_unused.A parameter set is not an environment: an environment declares run-time variables, secrets and feature flags that
${var:}/${secret:}/${feature:}resolve at build and deploy time. A parameter set’s values are read when the solution is loaded, before any of that runs.