hashicorp / terraform-plugin-go

A low-level Go binding for the Terraform protocol for integrations to be built on top of.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include Resource Private State In Protocol Data Output

bflad opened this issue · comments

terraform-plugin-go version

v0.13.0

Use cases

Using the TF_LOG_SDK_PROTO_DATA_DIR environment variable, it is possible to output the data being sent between Terraform and providers. This data does not currently include the resource private state, which is managed solely by providers, but must be passed across the protocol to be preserved. It can be helpful to see this data when troubleshooting private state functionality.

Attempted solutions

Viewing private state information via the state file from manual Terraform executions, outside the provider acceptance testing framework.

Proposal

For protocol RPCs that have private state fields, include them in TF_LOG_SDK_PROTO_DATA_DIR output:

  • If empty, writing a ..._{FIELD}.empty file.
  • If non-empty, writing the []byte directly to a ..._{FIELD} file.

References