From 04d0d0f0aed2b0c8cba778576bdd5f3df0c2d6e1 Mon Sep 17 00:00:00 2001 From: Nick Walke Date: Fri, 7 Oct 2016 10:20:17 -0500 Subject: [PATCH] Added explicit map and list variable usage This page did not show how to actually use a list as a list. The variables page states that "The usage of maps, list, strings, etc. is documented fully in the interpolation syntax page", but that wasn't the case. I've split them out to list them explicitly and provide examples of each. Closes #9037 --- .../source/docs/configuration/interpolation.html.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/website/source/docs/configuration/interpolation.html.md b/website/source/docs/configuration/interpolation.html.md index 834f25c4b..a81d2d26f 100644 --- a/website/source/docs/configuration/interpolation.html.md +++ b/website/source/docs/configuration/interpolation.html.md @@ -25,10 +25,15 @@ will be rendered as a literal `${foo}`. **To reference user variables**, use the `var.` prefix followed by the variable name. For example, `${var.foo}` will interpolate the -`foo` variable value. If the variable is a map, then you -can reference static keys in the map with the syntax -`var.MAP["KEY"]`. For example, `${var.amis["us-east-1"]` would -get the value of the `us-east-1` key within the `amis` map variable. +`foo` variable value. + +**To reference user map variables**, the syntax is `var.MAP["KEY"]`. For +example, `${var.amis["us-east-1"]}` would get the value of the `us-east-1` +key within the `amis` map variable. + +**To reference user list variables**, the syntax is `["${var.LIST}"]`. For +example, `["${var.subnets}"]` would get the value of the `subnets` list, as a +list. **To reference attributes of your own resource**, the syntax is `self.ATTRIBUTE`. For example `${self.private_ip_address}` will