Skip to content

Commit 415a16c

Browse files
committedMar 13, 2019
Adding a readme/guide on adding examples
1 parent 9a2f87b commit 415a16c

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
 

‎examples/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Examples
2+
3+
This folder contains examples of using [Terraform's Azure Provider](https://terraform.io/docs/providers/azurerm/index.html) to provision resources in Azure - in which the examples are grouped by the service, for example Virtual Networks or Virtual Machines.

‎examples/adding-examples.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Guide: Adding a new example
2+
3+
Firstly - thanks for your interest in adding a new example!
4+
5+
The examples folder is now backed by a Test Framework which requires certain files exist within a Directory. For the tests to run, the following files must exist:
6+
7+
* `main.tf` - which contains the code for the example
8+
* `README.md` - which contains an summary of what will be provisioned
9+
* `variables.tf` - which contains all of the variables used in this example
10+
11+
Other files and directories may exist in this directory, such as any sub-modules; however there must be no `provider` or `terraform` blocks specified in the example - since these will be generated by the test framework (and this will conflict).
12+
13+
---
14+
15+
### Variable Population
16+
17+
Terraform prompts users to insert values for variables which do not have a default value - as such the Test Framework populates certain variable values which are documented below.
18+
19+
The following Variables are required in (almost) all examples:
20+
21+
* `location` - The Location in which the Resources should be provisioned.
22+
23+
* `prefix` - A prefix which should be used for all resources in this example. This value will be generated as a short string.
24+
25+
In addition the following variables can optionally be used (and will be pre-populated) at this time:
26+
27+
* `alt_location` - The Alternate Location which should be used for provisioning resources.
28+
29+
* `kubernetes_client_id` - The Client ID of the Service Principal which can be reused by Kubernetes.
30+
31+
* `kubernetes_client_secret` - The Client Secret of the Service Principal which can be reused by Kubernetes.
32+
33+
If you require further variables which cannot have a default value, we can investigate adding these as required - please open a GitHub issue and we can discuss this further :)

0 commit comments

Comments
 (0)
Please sign in to comment.