mirror of https://github.com/hashicorp/terraform
We now have native language features for declaring tuples and objects, which are the idiomatic way to construct sequence and mapping values that can then be converted to list, set, and map types as needed.pull/19548/head
parent
8cf024d45a
commit
4927a4105b
@ -0,0 +1,13 @@
|
||||
locals {
|
||||
list = "${list("a", "b", "c")}"
|
||||
list_concat = "${concat(list("a", "b"), list("c"))}"
|
||||
list_empty = "${list()}"
|
||||
|
||||
map = "${map("a", "b", "c", "d")}"
|
||||
map_merge = "${merge(map("a", "b"), map("c", "d"))}"
|
||||
map_empty = "${map()}"
|
||||
map_invalid = "${map("a", "b", "c")}"
|
||||
|
||||
list_of_map = "${list(map("a", "b"))}"
|
||||
map_of_list = "${map("a", list("b"))}"
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
locals {
|
||||
list = ["a", "b", "c"]
|
||||
list_concat = concat(["a", "b"], ["c"])
|
||||
list_empty = []
|
||||
|
||||
map = {
|
||||
"a" = "b"
|
||||
"c" = "d"
|
||||
}
|
||||
map_merge = merge(
|
||||
{
|
||||
"a" = "b"
|
||||
},
|
||||
{
|
||||
"c" = "d"
|
||||
},
|
||||
)
|
||||
map_empty = {}
|
||||
map_invalid = map("a", "b", "c")
|
||||
|
||||
list_of_map = [
|
||||
{
|
||||
"a" = "b"
|
||||
},
|
||||
]
|
||||
map_of_list = {
|
||||
"a" = ["b"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
terraform {
|
||||
required_version = ">= 0.12"
|
||||
}
|
||||
Loading…
Reference in new issue