terraform-plugin-docs
terraform-plugin-docs copied to clipboard
Show default values for supported timeouts
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.
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.
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)?
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.
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?
I do yes but it doesn’t work for the separately-generated timeouts values