Skip to content

Document the Example

GlennChia edited this page Jul 7, 2021 · 1 revision

and whether there are any resource dependencies.

Adding documentation

Referencing consumption_budgets where there are 4 provided examples, within the examples/consumption_budget directory. Add a README.md and a main.tf file to the examples/consumption_budget directory as shown below.

├───.github
│   └───workflows
│       └───standalone-scenarios.json
├───examples
│   |───consumption_budget
│   |   |───100-consumption-budget-rg
|   |   |     └───configuration.tfvars
│   |   |───101-consumption-budget-subscription
|   |   |    └───configuration.tfvars
│   |   |───102-consumption-budget-rg-alerts
|   |   |    └───configuration.tfvars
│   |   |───103-consumption-budget-subscription-alerts
|   |   |    └───configuration.tfvars
│   |   |───README.md
│   |   └───main.tf
│   |───module.tf
│   └───variables.tf

main.tf

The main.tf file is only needed for the examples to be displayed on the Terraform Registry. Copy the following contents into it:

# This is an empty file for Terraform registry visibility.
# For examples on how to consume the CAF module, please refer to https://github.com/aztfmod/terraform-azurerm-caf/tree/master/examples

README.md

Refer to Consumption budgets README for a sample README.

Overall it is broken down into the following sections:

  1. Brief description of instantiating CAF: This is standardized across all README files
  2. Example scenarios: A table of the examples that are in the current directory. This consists of the example name and a description of the example.
  3. Commands to get started: Includes the Terraform and Rover commands that are used to plan/apply/destroy the example. THe important thing to note is to adjust the paths given to -var-file and -var-folder
Clone this wiki locally