terrajet icon indicating copy to clipboard operation
terrajet copied to clipboard

Figure out how to get CRD documentation from Terraform

Open muvaf opened this issue 2 years ago • 5 comments

What problem are you facing?

Currently fields don't have any documentation since most of TF providers do not fill Description field of the Schema objects.

How could Terrajet help solve your problem?

We should investigate how https://registry.terraform.io/providers/hashicorp/aws/latest/docs and other docs are produced and see how we can add description comments to generated fields.

muvaf avatar Oct 07 '21 18:10 muvaf

https://github.com/crossplane-contrib/provider-jet-gcp/blob/release-0.1-preview/apis/cloudplatform/v1alpha1/zz_project_types.go

It seems like in some cases we do have this - I just noticed provider-jet-gcp seems to. Is this because they fill the Description when others don't?

On a related note, I was coming here to report that sometimes this commentary is misleading. For example at: https://doc.crds.dev/github.com/crossplane-contrib/provider-jet-gcp/cloudplatform.gcp.jet.crossplane.io/Project/[email protected]

The numeric ID of the organization this project belongs to. Changing this forces a new project to be created. Only one of org_id or folder_id may be specified. If the org_id is specified then the project is created at the top level. Changing this forces the project to be migrated to the newly specified organization.

I don't think we'll actually recreate a new project as this documentation states.

negz avatar Nov 23 '21 00:11 negz

Just came across this issue and I think I've found where terraform documentation for provider resources are coming from:

All content seems to be living as markdown files under webside/docs in each provider repo:

https://github.com/hashicorp/terraform-provider-aws/tree/main/website/docs https://github.com/hashicorp/terraform-provider-google/tree/master/website/docs https://github.com/hashicorp/terraform-provider-azurerm/tree/main/website/docs

For example, documentation for aws_instance is here: https://github.com/hashicorp/terraform-provider-aws/blob/main/website/docs/r/instance.html.markdown

turkenh avatar Dec 03 '21 20:12 turkenh

I just noticed provider-jet-gcp seems to. Is this because they fill the Description when others don't?

@negz Yes, that's the case. GCP fills Description while AWS doesn't.

I don't think we'll actually recreate a new project as this documentation states.

Here is the fix https://github.com/crossplane-contrib/provider-jet-gcp/pull/10

muvaf avatar Dec 03 '21 23:12 muvaf

A relevant proposal's reference: https://github.com/crossplane/crossplane/pull/2956

ulucinar avatar Mar 31 '22 18:03 ulucinar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 00:08 stale[bot]