Skip to main content
Version: v5.7.0

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 of project, 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​

FlagMeaning
--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​

VariableMeaning
OPSCHAIN_PROPERTIESThe property-writes file this command appends to (set by the executor).

Exit codes​

CodeMeaning
0Write recorded.
1The value file or the property-writes file could not be read/written.
2Usage error.

Named errors​

  • layer "<layer>" is not one of project, environment, asset
  • property path "<path>" has an empty segment: use non-empty dot-separated segments
  • pass the value as an argument or via --value-file, not both
  • a value is required: pass it as an argument or via --value-file
  • $OPSCHAIN_PROPERTIES is not set: opschain step subcommands 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.