terraform/builtin/providers/terraform
James Nugent bdc6a49ae3 provider/terraform: Fix outputs from remote state
The work integrated in hashicorp/terraform#6322 silently broke the
ability to use remote state correctly. This commit adds a fix for that,
making use of the work integrated in hashicorp/terraform#7124.

In order to deal with outputs which are complex structures, we use a
forked version of the flatmap package - the difference in the version
this commit vs the github.com/hashicorp/terraform/flatmap package is
that we add in an additional key for map counts which state requires.
Because we bypass the normal helper/schema mechanism, this is not set
for us.

Because of the HIL type checking of maps, values must be of a homogenous
type. This is unfortunate, as it means we can no longer refer to outputs
as:

    ${terraform_remote_state.foo.output.outputname}

Instead we had to bring them to the top level namespace:

    ${terraform_remote_state.foo.outputname}

This actually does lead to better overall usability - and the BC
breakage is made better by the fact that indexing would have broken the
original syntax anyway.

We also add a real-world test and assert against specific values. Tests
which were previously acceptance tests are now run as unit tests, so
regression should be identified at a much earlier stage.
2016-06-11 16:53:45 +01:00
..
test-fixtures provider/terraform: Fix outputs from remote state 2016-06-11 16:53:45 +01:00
data_source_state.go provider/terraform: Fix outputs from remote state 2016-06-11 16:53:45 +01:00
data_source_state_test.go provider/terraform: Fix outputs from remote state 2016-06-11 16:53:45 +01:00
flatten.go provider/terraform: Fix outputs from remote state 2016-06-11 16:53:45 +01:00
provider.go helper/schema: emit warning when using data source resource shim 2016-05-14 08:26:36 -07:00
provider_test.go providers/terraform: remote state resource 2015-03-11 18:17:47 -05:00