IssueRaiser

Unknown values should not block successful planning

The idea of "unknown values" is a crucial part of how Terraform implements planning as a separate step from applying. An unknown value is a placeholder for a value that Terraform (most often, a Terraform provider) cannot know until the apply step. Unknown values allow Terraform to still keep track of type information where possible, even if the exact values aren't known, and allow Terraform to be explicit in its proposed plan output about which values it can predict and which values it cannot. Internally, Terraform performs checks to ensure that the final arguments for a resource instance at the apply step _conform to_ the arguments previously shown in the plan: known values must remain exactly equal, while unknown values must be replaced by known values matching the unknown value's type constraint. Through this mechanism, Terraform aims to promise that the apply phase will use the same settings as were used during planning, or Terraform will return an error explaining that it could not. > (For a longer and deeper overview of what unknown values represent and how Terraform treats them, see my blog post _[Unknown Values: The Secret to Terraform Plan](https://log.martinatkins.me/2021/06/14/terraform-plan-unknown-values/)_.) The design goal for unknown values is that Terraform should always be able to produce some sort of plan, even if parts of it are not yet known, and then it's up to the user to review the plan and decide either to accept the risk that the unknown values m

Posted by apparentlymart on Apr 26, 2022, 9:57 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

github (Other)

Unknown values should not block successful planning

apparentlymartApr 26, 2022, 9:57 PM

The idea of "unknown values" is a crucial part of how Terraform implements planning as a separate step from applying. An unknown value is a placeholder for a value that Terraform (most often, a Terraform provider) cannot know until the apply step. Unknown values allow Terraform to still keep track of type information where possible, even if the exact values aren't known, and allow Terraform to be explicit in its proposed plan output about which values it can predict and which values it cannot. Internally, Terraform performs checks to ensure that the final arguments for a resource instance at the apply step _conform to_ the arguments previously shown in the plan: known values must remain exactly equal, while unknown values must be replaced by known values matching the unknown value's type constraint. Through this mechanism, Terraform aims to promise that the apply phase will use the same settings as were used during planning, or Terraform will return an error explaining that it could not. > (For a longer and deeper overview of what unknown values represent and how Terraform treats them, see my blog post _[Unknown Values: The Secret to Terraform Plan](https://log.martinatkins.me/2021/06/14/terraform-plan-unknown-values/)_.) The design goal for unknown values is that Terraform should always be able to produce some sort of plan, even if parts of it are not yet known, and then it's up to the user to review the plan and decide either to accept the risk that the unknown values m

Comments (0)

No comments yet. Start the discussion.

Comment on this issue