Deferrals Reference
A value known only after an apply — an ID the provider mints, a cluster endpoint — defers what needs it at plan to the next round. apply plans that round by itself, so a convergence runs as many rounds as the configuration’s dependencies need, each stopping at its own approval point. Converge the configuration as it stands: never rewrite it to stage an apply, nor hard-code a value to skip a round.
Where they show
Section titled “Where they show”plan.deferredcounts what this round defers; above zero, another round follows.- The document’s
deferred_changes[]lists each deferred resource with itsreason. A deferred data source is listed as acreateorupdatechange, not aread. - A module call whose
countorfor_eachis unknown defers whole: it is counted inplan.deferredbut absent fromdeferred_changes, which cannot list instances before the call expands.plan.deferred: 1with an emptydeferred_changesis that case, and another round follows. rounds[].deferredrecords each round’s count.
Reasons
Section titled “Reasons”| Reason | What happened | What resolves it |
|---|---|---|
instance_count_unknown |
A count or for_each reads something not yet applied: the resource, data source or action it expands waits. |
The apply that makes it known. |
provider_config_unknown |
The provider’s block reads something not yet applied (host = kind_cluster.demo.endpoint), and the provider cannot plan with the unknowns. |
The apply of what the block reads. |
resource_config_unknown |
The provider deferred the resource itself (a custom resource ahead of its CRD), or an import {} block aimed at it has an unknown id/identity, to key or for_each. |
The apply of what the provider was waiting on, or of what the locator reads. |
absent_prereq |
It depends, through any edge — a value, depends_on, its module, an action — on something deferred. |
The deferral it depends on. |
action_deferred |
An action it triggers is deferred, and an event fires once, with its operation: the resource waits with it. | The action’s deferral. |
unknown |
The provider gave a reason this engine does not recognize. | Read the round’s diagnostics. |
Repetition must be known at plan. An unknown count/for_each defers; a known but invalid one (null, negative, sensitive) is a plan error naming the address. An empty for_each is valid: zero instances.
Differs from Terraform: a count whose only unknown is an impure function (timestamp(), uuid()) is refused, not deferred — no later round would make it known.
Cluster → CRD → custom resource
Section titled “Cluster → CRD → custom resource”The canonical multi-round configuration:
resource "kind_cluster" "demo" { name = "turf-demo" }
provider "kubernetes" { host = kind_cluster.demo.endpoint client_certificate = kind_cluster.demo.client_certificate client_key = kind_cluster.demo.client_key cluster_ca_certificate = kind_cluster.demo.cluster_ca_certificate}
resource "kubernetes_manifest" "crd" { /* a CustomResourceDefinition */ }resource "kubernetes_manifest" "instance" { /* an object of that custom kind */ depends_on = [kubernetes_manifest.crd]}- Round 1 creates the cluster. The kubernetes provider’s block reads endpoints not yet known, so both manifests defer (
provider_config_unknown). - Round 2: the block now resolves against the applied cluster, and the CRD plans and applies. The instance cannot be planned until the API server knows its kind, so the provider defers it (
resource_config_unknown). - Round 3 creates the instance.
How many rounds it takes depends on the provider: one that accepts unknown configuration is configured at apply instead and may plan more in an earlier round. Each round starts its providers afresh, so a round sees what the last one applied — a new cluster’s API, a CRD’s new kind — rather than what a long-lived plugin process cached.
When it does not converge
Section titled “When it does not converge”stalled— a round applied nothing and still defers: another round would plan the same thing. The value the deferral waits on will never become known from here. Read the last plan’sdeferred_changesand the round’sdiagnostics: usually a reference to something nothing creates, a provider that can never be configured (credentials missing), or a cycle through a provider block. Change the configuration or the values, and runupagain.exhausted—max_rounds(default 5) was reached with work still deferred. A long chain may need more: runupagain to continue from what was applied, or pass a largermax_rounds.- A value that stays
__cty_unknown__with nothing left to apply is the same story asstalled: check what it reads.
Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.
© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub