-
Notifications
You must be signed in to change notification settings - Fork 36
tftypes: add tftypes.Value.IsFullyNull()
#541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tftypes.IsFullyNull()
tftypes.Value.IsFullyNull()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code itself looks good, I did have one question. Can we also add a changelog for this?
cc: @dbanck In Plugin SDK and Framework, we will return an error diagnostic when a null or "empty" resource identity would be returned for a resource that has an identity schema. As defined here, "empty" (or How well does this agree with Terraform? |
Related Issue
For hashicorp/terraform-plugin-framework#1193, to fix hashicorp/terraform-plugin-framework#1184.
Description
This pull request adds a method to
tftypes.Value
that returnstrue
for an object that has all null attributes. In this way,IsNull
/IsFullyNull
mirror the existingIsKnown
/IsFullyKnown
.For example, the equivalent
tftypes.Value
of this value is "fully null":This introduces no behavior changes to
terraform-plugin-go
. It provides a type system utility for SDKs to consume. For example,terraform-plugin-framework
can usetftypes.Value.IsFullyNull()
to reject "fully null" resource identity values from RPC responses.cc: @austinvalle
Rollback Plan
Changes to Security Controls
No.