terraform/config/test-fixtures
James Nugent f49583d25a core: support native list variables in config
This commit adds support for native list variables and outputs, building
up on the previous change to state. Interpolation functions now return
native lists in preference to StringList.

List variables are defined like this:

variable "test" {
    # This can also be inferred
    type = "list"
    default = ["Hello", "World"]
}

output "test_out" {
    value = "${var.a_list}"
}
This results in the following state:

```
...
            "outputs": {
                "test_out": [
                    "hello",
                    "world"
                ]
            },
...
```

And the result of terraform output is as follows:

```
$ terraform output
test_out = [
  hello
  world
]
```

Using the output name, an xargs-friendly representation is output:

```
$ terraform output test_out
hello
world
```

The output command also supports indexing into the list (with
appropriate range checking and no wrapping):

```
$ terraform output test_out 1
world
```

Along with maps, list outputs from one module may be passed as variables
into another, removing the need for the `join(",", var.list_as_string)`
and `split(",", var.list_as_string)` which was previously necessary in
Terraform configuration.

This commit also updates the tests and implementations of built-in
interpolation functions to take and return native lists where
appropriate.

A backwards compatibility note: previously the concat interpolation
function was capable of concatenating either strings or lists. The
strings use case was deprectated a long time ago but still remained.
Because we cannot return `ast.TypeAny` from an interpolation function,
this use case is no longer supported for strings - `concat` is only
capable of concatenating lists. This should not be a huge issue - the
type checker picks up incorrect parameters, and the native HIL string
concatenation - or the `join` function - can be used to replicate the
missing behaviour.
2016-05-10 14:49:14 -04:00
..
copy-basic
count-int
count-string
count-var
dir-basic
dir-empty
dir-merge
dir-override
dir-temporary-files
import
interpolations
validate-bad-depends-on
validate-bad-multi-resource
validate-count-bad-context
validate-count-below-zero
validate-count-count-var
validate-count-int
validate-count-module-var
validate-count-not-int
validate-count-resource-var
validate-count-user-var
validate-count-var
validate-count-var-invalid
validate-count-zero
validate-depends-on-var
validate-dup-module
validate-dup-resource
validate-good
validate-module-name-bad
validate-module-source-var
validate-module-var-int
validate-module-var-list core: support native list variables in config 2016-05-10 14:49:14 -04:00
validate-module-var-map core: support native list variables in config 2016-05-10 14:49:14 -04:00
validate-module-var-self
validate-output-bad-field
validate-path-var
validate-path-var-invalid
validate-prov-conn-splat-other
validate-prov-conn-splat-self
validate-prov-splat-other
validate-prov-splat-self
validate-provider-multi
validate-provider-multi-good
validate-provider-multi-ref-bad
validate-provider-multi-ref-good
validate-resource-prov-self
validate-resource-self
validate-unknown-resource-var
validate-unknown-resource-var-output
validate-unknownthing
validate-unknownvar
validate-unknownvar-count
validate-var-default
validate-var-default-interpolate
validate-var-default-list-type core: support native list variables in config 2016-05-10 14:49:14 -04:00
validate-var-module
validate-var-module-invalid
validate-var-multi-exact-non-slice
validate-var-multi-func
validate-var-multi-non-slice
validate-var-multi-non-slice-provisioner
.gitattributes
attributes.tf
attributes.tf.json
bad-variable-type.tf
bad_type.tf.nope
basic.tf
basic.tf.json
connection.tf
create-before-destroy.tf
empty.tf
escapedquotes.tf
heredoc.tf
ignore-changes.tf
import.tf
lifecycle_cbd_typo.tf
modules.tf
prevent-destroy-string.tf
provisioners.tf
resource-arity-mistake.tf
variable-mismatched-type.tf
variables.tf
windows-line-endings.tf