Pcornel
Automation · Automation Fundamentals

Declarative Automation

Cheat sheet · https://pcornel.dk/topic.php?topic=5155

Back to the Topic

Answer

Declarative Automation expresses the intended end state or policy and lets an engine determine the actions required to converge current state toward that declaration.

Remember

  • Declarative ≠ idempotent automatically; provider behavior, unknown state and side effects can still break convergence.
  • Declarative ≠ no ordering; dependencies and resource graphs still impose execution relationships.
  • Desired configuration ≠ observed reality; drift and failed apply can leave state divergent.
  • Less procedural code ≠ less operational complexity; the engine/provider absorbs some complexity rather than eliminating it.

First checks

  • terraform plan — declared vs actual
  • kubectl diff -f manifest.yaml — Kubernetes declarative diff
  • ansible-playbook --check --diff — declared state preview

Verify in this order

desired state declaration → engine computes changes → apply

Where it usually breaks

A valid declaration expresses intent; it does not prove the engine can reach that state or that the provider will do so without disruptive replacement.

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Declarative Automation automation boundary map

BoundaryHealthy evidenceSuspicious evidence
Intent / inputsOwner, scope and authoritative inputs are explicit and versioned where applicableHidden defaults, stale inventory or competing sources of truth
Decision / executionPlan or decision is explainable and actions are bounded per targetBlind fan-out, implicit assumptions or success based only on executor status
State / verificationTarget is re-observed and acceptance criteria prove the intended outcomeNo read-back, perpetual drift, partial side effects or unresolved exceptions
Recovery / evidenceRetry, rollback or escalation behavior is defined and auditableUnknown partial completion, unsafe retry or evidence lost during remediation

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5155

Confirmation

Confirm action

Continue?