From 0d5f86bd0d8dac94a25ca5238bdba85f6d863710 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Mon, 24 Oct 2016 20:05:25 +1100 Subject: [PATCH] Cleanup of the resources and variables pages 1. Added a heredoc example to the variables page. 2. Tidied up and added headers. 3. Some minor whitespace and grammar edits. --- .../docs/configuration/resources.html.md | 24 +++++++++++++------ .../docs/configuration/variables.html.md | 18 ++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/website/source/docs/configuration/resources.html.md b/website/source/docs/configuration/resources.html.md index e63dce738..e69b3561f 100644 --- a/website/source/docs/configuration/resources.html.md +++ b/website/source/docs/configuration/resources.html.md @@ -41,6 +41,8 @@ configuration is dependent on the type, and is documented for each resource type in the [providers section](/docs/providers/index.html). +### Meta-parameters + There are **meta-parameters** available to all resources: * `count` (int) - The number of identical resources to create. @@ -78,7 +80,7 @@ The `lifecycle` block allows the following keys to be set: ~> **NOTE on create\_before\_destroy and dependencies:** Resources that utilize the `create_before_destroy` key can only depend on other resources that also include `create_before_destroy`. Referencing a resource that does not include -`create_before_destroy` will result in a dependency graph cycle. +`create_before_destroy` will result in a dependency graph cycle. ~> **NOTE on ignore\_changes:** Ignored attribute names can be matched by their name, not state ID. For example, if an `aws_route_table` has two routes defined @@ -88,7 +90,7 @@ which will match all attribute names. Using a partial string together with a wildcard (e.g. `"rout*"`) is **not** supported. -------------- +### Connection block Within a resource, you can optionally have a **connection block**. Connection blocks describe to Terraform how to connect to the @@ -103,7 +105,7 @@ but other data must be specified by the user. The full list of settings that can be specified are listed on the [provisioner connection page](/docs/provisioners/connection.html). -------------- +### Provisioners Within a resource, you can specify zero or more **provisioner blocks**. Provisioner blocks configure @@ -129,8 +131,9 @@ You can use the `${count.index}` [interpolation](/docs/configuration/interpolation.html) along with a map [variable](/docs/configuration/variables.html) to accomplish this. -For example, here's how you could create three [AWS Instances](/docs/providers/aws/r/instance.html) each with their own static IP -address: +For example, here's how you could create three [AWS +Instances](/docs/providers/aws/r/instance.html) each with their own +static IP address: ``` variable "instance_ips" { @@ -171,8 +174,15 @@ The value of the field should be `TYPE` or `TYPE.ALIAS`. The `ALIAS` value comes from the `alias` field value when configuring the [provider](/docs/configuration/providers.html). -If no `provider` field is specified, the default (provider with no alias) -provider is used. +``` +provider "aws" { + alias = "west" + + # ... +} +``` + +If no `provider` field is specified, the default provider is used. ## Syntax diff --git a/website/source/docs/configuration/variables.html.md b/website/source/docs/configuration/variables.html.md index c306d8577..b6ac69abd 100644 --- a/website/source/docs/configuration/variables.html.md +++ b/website/source/docs/configuration/variables.html.md @@ -75,6 +75,8 @@ These are the parameters that can be set: **Note**: Default values can be strings, lists, or maps. If a default is specified, it must match the declared type of the variable. +### Strings + String values are simple and represent a basic key to value mapping where the key is the variable name. An example is: @@ -85,6 +87,20 @@ variable "key" { } ``` +A multi-line string value can be provided using heredoc syntax. + +``` +variable "long_key" { + type = "string" + default = <