You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The framework should let provider developers know when their managed resource Read or UpgradeState method implementations are incorrect. This is preferable to happen in the framework since Terraform core does not raise its own error currently, which means that even if/when it does, it will only occur in upgraded Terraform environments.
This can be implemented by walking the response states and raising error diagnostics for all unknown values encountered. This should prevent Terraform from saving the errant state while also notifying practitioners and developers with explicit messaging about the problem.
…e errors
Reference: #902
Reference: hashicorp/terraform#34502
Reference: hashicorp/terraform#34503
Unknown values are never valid in resource state and while Terraform nor the framework actually raise these errors right now, one or both will in the near future. This documents the errant implementation detail for developers in the meantime since it otherwise causes confusing Terraform behaviors for practitioners.
…e errors (#903)
Reference: #902
Reference: hashicorp/terraform#34502
Reference: hashicorp/terraform#34503
Unknown values are never valid in resource state and while Terraform nor the framework actually raise these errors right now, one or both will in the near future. This documents the errant implementation detail for developers in the meantime since it otherwise causes confusing Terraform behaviors for practitioners.
bflad
changed the title
Consider Explicit Error Diagnostics When ReadResource/UpgradeResourceState Response State Includes Unknown Value
Consider Explicit Error Diagnostics When MoveResourceState/ReadResource/UpgradeResourceState Response State Includes Unknown Value
Feb 28, 2024
Module version
Relevant provider source code
ReadResource
case:UpgradeResourceState
case:Terraform Configuration Files
Expected Behavior
The framework should let provider developers know when their managed resource
Read
orUpgradeState
method implementations are incorrect. This is preferable to happen in the framework since Terraform core does not raise its own error currently, which means that even if/when it does, it will only occur in upgraded Terraform environments.This can be implemented by walking the response states and raising error diagnostics for all unknown values encountered. This should prevent Terraform from saving the errant state while also notifying practitioners and developers with explicit messaging about the problem.
Actual Behavior
Weird behaviors next
terraform plan
as noted in hashicorp/terraform#34502 (confusing error after errantRead
) and hashicorp/terraform#34503 (confusing plan after errantUpgradeState
).Steps to Reproduce
terraform apply
terraform plan
References
Failed to marshal plan to json: value is not known
onterraform-plugin-testing@v1.6.0
terraform-plugin-testing#262The text was updated successfully, but these errors were encountered: