Skip to main content
An auto-reconcile policy re-applies a stack’s declared state on a schedule, without you running apply yourself. It’s how you keep a stack pinned to its declared state continuously, instead of only at the moment you happen to deploy it.

How it works

After each successful reconcile, formae records the resulting state. At the configured interval, it compares the stack’s current state against that recorded state. If it finds any deviation, it automatically runs a hard reconcile: declared state wins, and any drift is overwritten. The interval timer restarts after each reconcile completes, so reconciliations stay evenly spaced regardless of how long any single one takes.

Configuration

Relationship to synchronization

Synchronization is what detects drift: changes made through the cloud console, another tool, or a formae patch. Without auto-reconcile, that drift just sits there until your next apply, and soft reconcile will stop you to review it. Auto-reconcile skips that pause: it applies a hard reconcile automatically on every interval, so drift never survives longer than one cycle.
Auto-reconcile suits production stacks where configuration consistency matters more than allowing manual experimentation. For a dev environment where you want room to poke at things through the console, leave it off.

Examples

Inline auto-reconcile policy:
Reusable auto-reconcile policy, shared across every production stack:
Combining with a TTL policy, for a staging stack that stays enforced while it lives, then expires:

Use cases

  • Security compliance: security groups and IAM policies always match declared configuration; unauthorized changes get reverted automatically.
  • Production stability: desired state holds in critical infrastructure without manual intervention.
  • Multi-team environments: when several teams can reach the same infrastructure, auto-reconcile reverts changes made outside version-controlled IaC.

Monitoring

Shows which stacks have an auto-reconcile policy and its interval. Reconcile runs triggered by the policy show up in your regular command history:

Considerations

Interval selection. Balance responsiveness against cloud provider rate limits; very short intervals (under a minute) risk being throttled. Emergency changes. If you need a change to persist, either update your infrastructure code before the next cycle, or temporarily remove the policy. Interaction with patches. Auto-reconcile reverts patch-mode changes too. If you apply an urgent patch, the next auto-reconcile cycle undoes it unless you also update the declared state.

See also

  • Policy: inline vs. reusable policies, and how to query them.
  • TTL policy: expire a stack instead of enforcing it. The two can be combined on the same stack.
  • Synchronization: how formae detects the drift auto-reconcile undoes.
  • Apply modes: soft vs. hard reconcile, and what auto-reconcile automates.