terraform-plugin-framework icon indicating copy to clipboard operation
terraform-plugin-framework copied to clipboard

Consider Exposing Framework Provider Metadata

Open SBGoods opened this issue 6 months ago • 2 comments

Background

The terraform providers schema -json command allows Terraform to output provider-based information in machine-readable JSON format. Terraform ecosystem tooling such as terraform-plugin-docs and the Terraform Language Server, rely on this specification to operate. The command currently only exposes information surfaced from the Terraform Plugin Protocol's GetProviderSchema RPC and therefore has a tight dependency on Terraform core.

Since the provider schema information and other metadata are sourced from the providers themselves with no dependency on Terraform core, we can consider exposing a provider metadata function or RPC directly in the framework which provider developers can use to opt-in to outputting/exposing additional provider metadata.

Use-cases

  • Outputting framework specific types instead of go-cty types: https://github.com/hashicorp/terraform-plugin-framework/issues/182
  • Indicate whether or not a resource supports importing: https://github.com/hashicorp/terraform-plugin-framework/issues/160

terraform-plugin-docs:

  • https://github.com/hashicorp/terraform-plugin-framework/issues/625#issuecomment-1424690927
  • https://github.com/hashicorp/terraform-plugin-docs/issues/156#issuecomment-1440414771
  • https://github.com/hashicorp/terraform-plugin-docs/issues/333
  • https://github.com/hashicorp/terraform-plugin-docs/issues/64

SBGoods avatar Jul 29 '24 20:07 SBGoods