|
| 1 | +# Provider Documentation Standards |
| 2 | + |
| 3 | +In an effort to keep the [provider documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs) consistent, this page documents some standards that have been agreed on. |
| 4 | + |
| 5 | +This page will grow over time, and suggestions are welcome! |
| 6 | + |
| 7 | +## Notes |
| 8 | + |
| 9 | +Note blocks are used to provide additional information to users beyond the basic description of a resource, argument or attribute. |
| 10 | + |
| 11 | +In the past, there have been different approaches to how notes were formatted, some examples are: |
| 12 | + |
| 13 | +- Different words to indicate level of importance, e.g. `Info`, `Important`, `Caution`, and `Be Aware`. |
| 14 | +- Capitalisation differences, e.g. `Note:` vs `NOTE:`. |
| 15 | +- Whether or not a colon is included, e.g. `Note:` vs `Note`. |
| 16 | + |
| 17 | +Going forward, all notes should follow the exact same format (`(->|~>|!>) **Note:**`) where level of importance is indicated through the different types of notes as documented below. |
| 18 | + |
| 19 | +Breaking changes have previously been added as notes to the resource documentation. |
| 20 | +These should no longer be included, instead follow these guidelines: |
| 21 | + |
| 22 | +- Breaking changes in a minor version should be added to the top of the changelog. |
| 23 | +- Breaking changes in a major version should be added to the upgrade guide. |
| 24 | + |
| 25 | +> We may revisit the guidelines above and/or add a specific place in the documentation for all breaking changes in minor versions. |
| 26 | +
|
| 27 | +<!-- |
| 28 | + - TODO: Considerations for when to add notes? We probably don't want to overdo it (More relevant to informational notes) |
| 29 | +--> |
| 30 | + |
| 31 | +### Informational Note |
| 32 | + |
| 33 | +Informational note blocks should generally be used when a note provides additional useful information, recommendations and/or tips to the user. |
| 34 | + |
| 35 | +To add an informational note, use `-> **Note:**`, within the Terraform registry documentation this will template as a block with an info icon. |
| 36 | + |
| 37 | +For example, extra information on the supported values for an argument, possibly linking to external documentation for the resource/service: |
| 38 | + |
| 39 | +```markdown |
| 40 | +* `type` - (Required) The type. Possible values include `This`, `That`, and `Other`. |
| 41 | + |
| 42 | +-> **Note:** More information on each of the supported types can be found in [type documentation](link-to-additional-info) |
| 43 | +``` |
| 44 | + |
| 45 | +### Warning Note |
| 46 | + |
| 47 | +Warning note blocks should generally be used when a note provides information that the user will need to avoid certain errors, however if these errors are encountered they should not break anything or cause irreversible changes. |
| 48 | + |
| 49 | +To add a warning note, use `~> **Note:**`, within the Terraform registry documentation this will template as a block with a warning icon. |
| 50 | + |
| 51 | +For example, an argument that is optional but required when another argument is set to `true`: |
| 52 | + |
| 53 | +```markdown |
| 54 | +* `optional_argument_enabled` - (Optional) Is the optional argument enabled? Defaults to `false`. |
| 55 | + |
| 56 | +* `optional_argument` - (Optional) An optional argument. |
| 57 | + |
| 58 | +~> **Note:** The argument `optional_argument` is required when `optional_argument_enabled` is set to `true`. |
| 59 | +``` |
| 60 | + |
| 61 | +### Caution Note |
| 62 | + |
| 63 | +Caution note blocks should generally be used when a note provides critical information on potential irreversible changes, data loss or other things that can negatively affect a user's environment. |
| 64 | + |
| 65 | +To add a caution note, use `!> **Note:**`, within the Terraform registry documentation this will template as a block with a caution icon. |
| 66 | + |
| 67 | +For example, an argument that when set to `true` cannot be reversed without recreating the resource: |
| 68 | + |
| 69 | +```markdown |
| 70 | +* `irreversible_argument_enabled` - (Optional) Is irreversible argument enabled? Defaults to `false`. |
| 71 | + |
| 72 | +!> **Note:** The argument `irreversible_argument_enabled` cannot be disabled after being enabled. |
| 73 | +``` |
0 commit comments