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
This commit is contained in:
parent
4f8685b3ea
commit
04d0d0f0ae
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue