opschain step set-property
Included from Basic tier
opschain step set-property <layer> <dot.path> [<value>]
Records, from inside a running step, one property write applied as a JSON
Patch on the named layer's properties when the step succeeds. The write is
appended as a JSON line to the file named by $OPSCHAIN_PROPERTIES; nothing
is applied if the step fails.
<layer>is one ofproject,environment,asset.<dot.path>addresses the property with non-empty dot-separated segments (e.g.opschain.env.REGION).- The value parses as JSON when it is valid JSON (numbers, booleans, objects, arrays, quoted strings) and is taken as a plain string otherwise.
Secrets belong in the secret vault, never in properties — a value matching the run's mask set fails the step.
Flags
| Flag | Meaning |
|---|---|
--value-file <path> | Read the value from this file instead of the argument (- reads stdin) — for values beyond OS argument limits, e.g. properties-managed terraform state. Mutually exclusive with a <value> argument. |
Environment
| Variable | Meaning |
|---|---|
OPSCHAIN_PROPERTIES | The property-writes file this command appends to (set by the executor). |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Write recorded. |
| 1 | The value file or the property-writes file could not be read/written. |
| 2 | Usage error. |
Named errors
layer "<layer>" is not one of project, environment, assetproperty path "<path>" has an empty segment: use non-empty dot-separated segmentspass the value as an argument or via --value-file, not botha value is required: pass it as an argument or via --value-file$OPSCHAIN_PROPERTIES is not set:opschain stepsubcommands only work inside a running OpsChain step
All exit 2.
Examples
opschain step set-property environment opschain.env.REGION ap-southeast-2
opschain step set-property asset deploy.replicas 3
terraform state pull | opschain step set-property asset tf.state --value-file -
See also
opschain docs cli/step-remove-property— the matching delete.opschain learn 1.3— properties and settings.