Skip to content
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

tfprotov5+tfprotov6: Write-only Attribute Implementation #462

Merged
merged 24 commits into from
Jan 21, 2025

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented Jan 17, 2025

The next version of the plugin protocol (5.8/6.8) introduces a new write_only property to the Schema.Attribute message to specify a write-only attribute. Write-only attributes are attributes which do not have their values persisted to Terraform state. write_only is only applicable for managed resource attributes.

SBGoods and others added 21 commits August 21, 2024 15:34
…ename `PriorState` request fields to `State`.
…tributes

# Conflicts:
#	tfprotov5/internal/tfplugin5/tfplugin5.pb.go
#	tfprotov6/internal/tfplugin6/tfplugin6.pb.go
# Conflicts:
#	tfprotov5/ephemeral_resource.go
#	tfprotov5/internal/fromproto/ephemeral_resource.go
#	tfprotov5/internal/fromproto/ephemeral_resource_test.go
#	tfprotov5/internal/tfplugin5/tfplugin5.pb.go
#	tfprotov5/internal/tfplugin5/tfplugin5.proto
#	tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go
#	tfprotov5/internal/toproto/ephemeral_resource.go
#	tfprotov5/internal/toproto/ephemeral_resource_test.go
#	tfprotov5/tf5server/server.go
#	tfprotov6/ephemeral_resource.go
#	tfprotov6/internal/fromproto/ephemeral_resource.go
#	tfprotov6/internal/fromproto/ephemeral_resource_test.go
#	tfprotov6/internal/tfplugin6/tfplugin6.pb.go
#	tfprotov6/internal/tfplugin6/tfplugin6.proto
#	tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go
#	tfprotov6/internal/toproto/ephemeral_resource.go
#	tfprotov6/internal/toproto/ephemeral_resource_test.go
#	tfprotov6/tf6server/server.go
# Conflicts:
#	tfprotov5/internal/tfplugin5/tfplugin5.pb.go
#	tfprotov6/internal/tfplugin6/tfplugin6.pb.go
@SBGoods SBGoods requested a review from a team as a code owner January 17, 2025 19:35
austinvalle
austinvalle previously approved these changes Jan 21, 2025
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sorry I have one suggestion in the doc string just to be super explicit about the field

@@ -3,6 +3,15 @@

package tfprotov5

// ValidateResourceTypeConfigClientCapabilities allows Terraform to publish information
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My monthly reminder that this RPC is named different in protocol v5 😆

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific feedback to this work, more of an observation, but I see that Terraform core is sending these client capabilities in every RPC request regardless of whether we use them. So in theory we could add, say, the WriteOnlyAttributesAllowed capability to PlanResourceChange with an SDK only change.

Not saying we should, but thought it was interesting.

tfprotov6/schema.go Outdated Show resolved Hide resolved
tfprotov5/schema.go Outdated Show resolved Hide resolved
@SBGoods SBGoods merged commit afd18f1 into main Jan 21, 2025
92 checks passed
@SBGoods SBGoods deleted the SBGoods/write-only-attributes branch January 21, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants