-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
modify terraform providers schema -json
to include fields for default
, plan_modifiers
, and validators
#35646
Comments
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again! |
Thanks for filing the issue. Things like validators, plan modifiers, or even defaults are all essentially abstract actions that a provider takes based on various configuration parameters, not concrete values that can be represented in the schema. Since what you are looking for is more for documentation rather than data handling, and is outside of the control of the Terraform CLI, we can track the issue in the referenced framework issue rather than here. Thanks! |
@jbardin I appreciate your input.
If i may ask a clarifying quesiton: yes, they are descriptions but those are programmatically available to the schema from the providers / validators. The CLI is the tool that coordinates the providers, where else would this possibly be implemented? Users would like programatic information about the resources included in a provider... Perhaps the purpose of the schema isn't clear to me... To me, the schema should communicate relevant information about the resource's schemas. Today it does that but is missing a significant amount of information |
The schema is used by the CLI for type information, including function signatures. Terraform is essentially a statically typed language, and needs that metadata to manipulate, encode and decode the configuration and state values. This happens to give a good starting point for documentation generation, but its intended purpose was not for documentation. Some additions were made to assist in documentation generation, but in the long run a more extensible design needs to be created. Having this be driven by the developer experience team working on the provider framework makes sure the additions are reflective of their needs first, and can be implemented outside of the core CLI if possible. If there are changes useful to have the core CLI, we can integrated those into the plugin protocol as expose them needed. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Version
Use Cases
I want to improve the documentation generated from: https://github.com/hashicorp/terraform-plugin-docs
Attempted Solutions
you can jam a lot of information in to the description field
Proposal
the json schema generated from a provider / resource schema should include information information on:
default
plan_modifiers
validators
The plan modifiers could pull from descriptions provided by each. ex: https://github.com/hashicorp/terraform-plugin-framework/blob/main/resource/schema/stringplanmodifier/requires_replace.go#L27
Validators also seem to have the concept: https://github.com/hashicorp/terraform-plugin-framework-validators/blob/main/stringvalidator/any.go#L46
References
The text was updated successfully, but these errors were encountered: