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

[Proposal] Prototype of metadata generation to improve docs #2024

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

breathingdust
Copy link
Member

@breathingdust breathingdust commented Sep 18, 2024

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

The AWSCC provider relies on terraform-plugin-docs to generate Terraform Registry documentation from resource/data source schema. This limits the information we are able to use during documentation configuration to what is included in the resource schema. In some cases this isn't enough to do what we would like with the documentation. For example, currently we are not able to specify a service category in the Cloud Control documentation which leads to poor navigability of the resources within a service. If we were able to include additional metadata in the schema, we would have more flexibility. Unfortunately this is not something that is likely to be included in the short term in terraform-plugin-docs (hashicorp/terraform-plugin-docs#156).

As a potential workaround, this PR modifies the resource generation code to also emit a metadata file which can include whatever information about a resource you would like to include. A modified version of terraform-plugin-docs (currently fully working in an unpublished fork f-metadata-function) would look for these metadata files during documentation generation, and allow the data to be used in the templates. This PR includes the CloudFormation name for a resource, as well as the service name which can be used to specify a subcategory in the template frontmatter.

Currently only supports resources, will need to extend to data-sources if general shape of the solution accepted.

Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants