hashicorp / terraform-plugin-framework

A next-generation framework for building Terraform providers.
https://developer.hashicorp.com/terraform/plugin/framework
Mozilla Public License 2.0
303 stars 93 forks source link

Consider Exposing Framework Provider Metadata #1022

Open SBGoods opened 3 months ago

SBGoods commented 3 months ago

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

terraform-plugin-docs:

SBGoods commented 3 months ago

Another potential use case, exposing metadata about which attributes have a RequiresReplace plan modifier set: https://discuss.hashicorp.com/t/expose-requiresreplace-forcenew-attributes-in-provider-schema/68870

drewmullen commented 2 months ago

We would also love information on default values and potentially validations: