formae.value() wraps a regular value so you can attach extra behavior to it. Two modifiers are available: .opaque for secrets and .setOnce for values that should stay stable across applies.
Opaque values
.opaque marks a value as a secret that is never displayed to the user. Opaque values can still be referenced through .res and passed between resources, but they’re never shown in logs, output, or CLI results. Use it for passwords, API keys, and other sensitive fields.
.res:
setOnce
.setOnce generates or captures a value the first time it’s applied, then keeps it constant on every later apply, even if the expression that produced it would otherwise evaluate to something different. This matters for anything generated randomly: without .setOnce, a random password would get a new value on every apply.
random.id(16).toString() generates a random 16-character identifier; .setOnce ensures the same value is reused on every subsequent apply of this forma.
Combining opaque and setOnce
The two modifiers chain, which is the common case for generated secrets: stable across applies and never shown.See also
- Resolvable: how
.resreferences, including opaque values, are consumed by other resources.

