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

Show default values for supported timeouts

Open tylerFowler opened this issue 2 years ago • 5 comments

The AWS provider resource docs show not only which timeouts are supported -but also their default values from code. This would be a great addition to tfplugindocs.

tylerFowler avatar May 17 '23 18:05 tylerFowler

this already works pretty well today - timeouts show up in the generated documentation if you include it explicitly on your schema. this isn't something i'd like to see on all my resources though.

jacobbednarz avatar May 17 '23 22:05 jacobbednarz

Hi @tylerFowler 👋 As alluded to above, timeouts configuration will display in the default tfplugindocs resource documentation template in the schema section, if the attribute or block is in the schema. The AWS provider documentation for this resource is using a custom Markdown file to display the timeouts configuration section separately.

Are you looking for tfplugindocs to treat the timeouts attribute/block separately in the default resource template (removing it from the standard schema information and creating a separate Timeouts section)?

bflad avatar May 18 '23 15:05 bflad

Oh sorry, no, I'd like the default time values to appear. The section formatting as-is is awesome, what I'm missing from tfplugindocs is the actual default value:

create - (Default 75m)

My generated docs do not contain that "Default 75m" bit, but would be massively helpful.

tylerFowler avatar May 18 '23 17:05 tylerFowler

i mentioned this in https://github.com/hashicorp/terraform-plugin-docs/issues/71#issuecomment-1152842007 as well, but have you tried adding something like https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/sdkv2provider/provider.go#L33-L39 to your provider configuration? i don't explicitly have any timeouts added anywhere but it should work?

jacobbednarz avatar May 18 '23 23:05 jacobbednarz

I do yes but it doesn’t work for the separately-generated timeouts values

tylerFowler avatar May 20 '23 19:05 tylerFowler