terraform/builtin/providers
Martin Atkins 410b60cb7f Stop requiring multi-vars (splats) to be in array brackets
Prior to Terraform 0.7, lists in Terraform were just a shallow abstraction
on top of strings with a magic delimiter between items. Wrapping a single
string in brackets in the configuration was Terraform's prompt that it
needed to split the string on that delimiter during interpolation.

In 0.7, when first-class lists were added, this convention was preserved
by flattening lists-of-lists by one level when they were encountered in
configuration. However, there was an oversight in that change where it
did not correctly handle the case where the inner list was unknown.

In #14135 we removed some code that was flattening partially-unknown lists
into fully-unknown (untyped) values. This inadvertently exposed the missed
case from the previous paragraph, causing issues for list-wrapped splat
expressions with unknown members. While this worked fine for resources,
due to some fixup done inside helper/schema, this did not work for other
interpolation contexts such as module blocks.

Various attempts to fix this up and restore the flattening behavior
selectively were unsuccessful, due to a proliferation of assumptions all
over the core code that would be too risky to change just to fix this bug.

This change, then, takes the different approach of removing the
requirement that splats be presented inside list brackets. This
requirement didn't make much sense anymore anyway, since no other
list-returning expression had this constraint and so the rest of Terraform
was already successfully dealing with both cases.

This leaves us with two different scenarios:

- For resource arguments, existing normalization code in helper/schema
  does its own flattening that preserves compatibility with the common
  practice of using bracketed splats. This change proves this with a test
  within the "test" provider that exercises the whole Terraform core and
  helper/schema stack that assigns bracketed splats to list and set
  attributes.

- For arguments in other blocks, such as in module callsites, the
  interpolator's own flattening behavior applies to known lists,
  preserving compatibility with configurations from before
  partially-computed splats were possible, but those wishing to use
  partially-computed splats are required to drop the surrounding brackets.
  This is less concerning because this scenario was introduced only in
  0.9.5, so the scope for breakage is limited to those who adopted this
  new feature quickly after upgrading.

As of this commit, the recommendation is to stop using brackets around
splats but the old form continues to be supported for backward
compatibility. In a future _major_ version of Terraform we will probably
phase out this legacy form to improve consistency, but for now both
forms are acceptable at the expense of some (pre-existing) weird behavior
when _actual_ lists-of-lists are used.

This addresses #14521 by officially adopting the suggested workaround of
dropping the brackets around the splat. However, it doesn't yet allow
passing of a partially-unknown list between modules: that still violates
assumptions in Terraform's core, so for the moment partially-unknown lists
work only within a _single_ interpolation expression, and cannot be
passed around between expressions. Until more holistic work is done to
improve Terraform's type handling, passing a partially-unknown splat
through to a module will result in a fully-unknown list emerging on
the other side, just as was the case before #14135; this change just
addresses the fact that this was failing with an error in 0.9.5.
2017-05-23 11:22:37 -07:00
..
alicloud
archive
arukas
atlas
aws Fixes #14765 Handle migration when restoring db cluster from snapshot (#14766) 2017-05-23 18:48:15 +01:00
azure
azurerm Adding support for 4TB disks 2017-05-19 14:10:19 -07:00
bitbucket
chef
circonus core: Use environment variables to set VersionPrerelease at compile time 2017-05-22 10:49:15 -04:00
clc
cloudflare
cloudstack
cobbler
consul
datadog Added new evaluation_delay parameter (#14433) 2017-05-12 16:12:21 +03:00
digitalocean Fix parsing of digitalocean dns records (#14215) 2017-05-16 12:10:34 +03:00
dme provider/dme: Save records in lowercase to avoid diffs (#14130) 2017-05-02 06:36:16 +01:00
dns don't rename imports except to avoid collisions 2017-05-17 15:35:04 -04:00
dnsimple Make dnsimple_records importable (#9130) 2017-04-27 02:07:23 +12:00
docker provider/docker network alias (#14710) 2017-05-22 09:20:32 -04:00
dyn Add verbose Dyn provider logs (#14076) 2017-05-06 01:24:14 +02:00
external
fastly Mark the aws & gcs secrets as sensitive (#14634) 2017-05-18 15:29:13 -05:00
github Add github_team data source (#14614) 2017-05-22 16:29:18 +03:00
gitlab provider/gitlab: Adding default values to gitlab_project_hook resource 2017-05-04 19:59:32 +03:00
google Updated debug message in compute_firewall_migrate. (#14743) 2017-05-22 14:05:31 -07:00
grafana
heroku providers/heroku: import heroku_pipeline_coupling resource (#14495) 2017-05-17 09:53:08 -05:00
http http provider and http request data source 2017-05-08 17:37:48 -07:00
icinga2
ignition ignition: tests as unit test (#14703) 2017-05-22 16:40:41 +03:00
influxdb
kubernetes provider/kubernetes: Add support for Service (#14554) 2017-05-17 14:43:53 +02:00
librato
local
logentries
mailgun
mysql
newrelic
nomad provider/nomad: Update Nomad provider tests 2017-05-04 15:52:55 -04:00
ns1
null
oneandone
openstack Merge pull request #14704 from jtopjian/openstack-instance-tenantnet-fix 2017-05-22 09:29:11 -06:00
opsgenie
ovh provider/ovh: new provider (#12669) 2017-05-16 17:26:43 +03:00
packet
pagerduty provider/pagerduty: Randomize names in acceptance tests (#14364) 2017-05-11 09:14:30 -05:00
postgresql core: Use environment variables to set VersionPrerelease at compile time 2017-05-22 10:49:15 -04:00
powerdns
profitbricks Private images Fix (#14173) 2017-05-03 22:29:03 +03:00
rabbitmq
rancher rancher_environment: fix typo 2017-05-18 15:20:42 +02:00
random
rundeck adds `description` to `command` schema in `rundeck_job` resource 2017-05-11 14:30:21 +03:00
scaleway provider/scaleway: allow public_ip to be set (#14515) 2017-05-16 11:59:39 +03:00
softlayer
spotinst
statuscake
template
terraform
test Stop requiring multi-vars (splats) to be in array brackets 2017-05-23 11:22:37 -07:00
tls
triton Make triton machine deletes synchronous. 2017-05-11 11:42:15 +03:00
ultradns
vault provider/vault: Prevent panic when no secret found (#14435) 2017-05-13 01:14:14 +03:00
vcd
vsphere