Terraform / Editorial solution guide

Investigate an unknown value in a Terraform plan

Trace an unknown planned value through its dependencies and protect plan JSON during diagnosis.

About 3 min readContent reviewed

Read-only knowledge base ยท No public comments

Recognize the symptoms

A fictional review policy rejects a plan because an output needed for a downstream decision is unknown. The human-readable plan shows a value will be known after apply, while a separate JSON consumer reports it as empty. Neither observation proves that the resulting infrastructure will be wrong.

Understand the likely causes

  • The value may depend on an attribute computed by a provider or another planned operation. The JSON consumer may also have confused the unknown representation with an absent or empty value, or used the wrong plan artifact.

Record the exact decision

Identify the plan revision, workspace, resource address, attribute and policy decision. Preserve the original plan in restricted storage; plans and their JSON representations can contain sensitive values. Do not paste the artifact or credentials into a shared ticket. Record the policy version and sanitized failure context so the same decision can be reproduced.

Trace the value dependency

Inspect the configuration expression and its upstream resource or data-source values. Determine whether the value is unavailable until a provider operation or whether an input should already be known. Compare the actual plan representation with the documented JSON format, including the relevant unknown markers. A missing field, null, empty collection and unknown are not interchangeable conclusions.

Correct the consumer or configuration

If the consumer treats unknown as empty, update its interpretation and decide explicitly whether the policy must defer, reject or require further review. If configuration unnecessarily hides a value that should be known, propose the smallest reviewed correction. Do not hard-code a fictional identifier or apply a plan merely to force the policy to pass.

Review the resulting proposal

Generate a fresh plan only in an authorized lab with the same relevant input shape. Compare its target, proposed actions and unknown fields with the earlier hypothesis. Review unexpected replacement or deletion separately. A policy that accepts a plan does not prove that a later apply succeeds or that the resulting service is healthy.

Verify the fix

Test the policy with synthetic known, unknown and empty values, including a case that should remain rejected. Confirm the consumer distinguishes them and produces a clear decision without logging sensitive plan contents.

For any approved configuration correction, review a fresh plan under the intended scope and retain sanitized results. Escalate unresolved unknowns instead of asserting that they are safe.

Keep it from recurring

  • Version policy and fixtures with the module, protect plan artifacts, and review dependencies and retention. Assign an owner for unknown-value decisions and repeat checks when context changes.

Official references