Add documentation #
Documentation is autogenerated based on the resource and field configurations. This page describes how to add documentation to resources and fields.
For more information about types of resources and the generation process overall, see How Magic Modules works.
Before you begin #
- Complete the steps in Set up your development environment to set up your environment and your Google Cloud project.
- Ensure that your
magic-modules
,terraform-provider-google
, andterraform-provider-google-beta
repositories are up to date.cd ~/magic-modules git checkout main && git clean -f . && git checkout -- . && git pull cd $GOPATH/src/github.com/hashicorp/terraform-provider-google git checkout main && git clean -f . && git checkout -- . && git pull cd $GOPATH/src/github.com/hashicorp/terraform-provider-google-beta git checkout main && git clean -f . && git checkout -- . && git pull
Add documentation #
To preview the documentation:
- Generate the providers
- Copy and paste the generated documentation into the Hashicorp Registry’s Doc Preview Tool to see how it is rendered.
Add or modify documentation files #
- Open the resource documentation in
magic-modules/third_party/terraform/website/docs/r/
using an editor of your choice.- The name of the file is the name of the resource without a
google_
prefix. For example, forgoogle_compute_instance
, the file is calledcompute_instance.html.markdown
- The name of the file is the name of the resource without a
- Modify the documentation as needed according to Handwritten documentation style guide.
- Generate the providers
- Copy and paste the generated documentation into the Hashicorp Registry’s Doc Preview Tool to see how it is rendered.