integrations/terraform/DOCS.md
We maintain:
The full build process involves:
docs that re-builds and installs the provider locallytfplugindocs
and copying the reference into the mains docs directory.tfplugindocs which renders markdown
compatible with our documentation engine.To re-render the reference, run make docs.
When adding a new resource, the file is automatically generated and included in the indices by make docs.
By default, every resource is documented with the default template.
This template tries to include the example file named examples/resources/teleport_<resource-name>/resource.tf.
If you want to add custom text describing the resource, how it's used, or multiple examples, you can override the default template for this resource. To do so, copy the default template to create a resource specific template:
mkdir -p templates/resources
cp templates/resources.md.tmpl templates/resources/<resource_name>.md.tmpl
You can then edit the resource-specific template and add custom text, include more examples, ...
To include code examples, you can use the function tffile:
## Example Usage
<Tabs>
<TabItem label="secret token">
This is a secret provision token.
{{tffile "./examples/resources/teleport_provision_token/resource.tf" }}
</TabItem>
<TabItem label="iam token">
This is an IAM token:
{{tffile "./examples/resources/teleport_provision_token/iam.tf" }}
</TabItem>
</Tabs>