Skip to main content
A policy is a configurable behavior you attach to a stack. Where a forma declares what resources should exist, a policy declares how formae should manage the stack’s lifecycle over time, without you having to run another apply. formae has two built-in policy types:
  • TTL policy: destroys a stack and its resources after a set duration.
  • Auto-reconcile policy: re-applies the stack’s declared state at a fixed interval, undoing out-of-band and incremental changes.

Inline vs. reusable policies

You can define a policy two ways. Inline policies live directly inside a stack definition. They belong to that stack alone and are deleted along with it.
Reusable policies are standalone objects, defined once and referenced from any number of stacks with .res. Changes to the policy propagate to every stack that references it.
Reach for a reusable policy as soon as you find yourself copying the same ttl or interval value into more than one stack. A single source of truth means one edit updates every stack that uses it.

Querying policies

Lists reusable policies only, since inline policies have no independent identity outside their stack. To see which policy, inline or reusable, is attached to a given stack, check the stack itself:

See also