terraform/helper
Mitchell Hashimoto 39542898b0
helper/schema: mark diff as forcenew if element is computed
Fixes #10125

If the elements are computed and the field is ForceNew, then we should
mark the computed count as potentially forcing a new operation.

Example, assuming `groups` forces new...

**Step 1:**

    groups = ["1", "2", "3"]

At this point, the resource isn't create, so this should result in a
diff like:

    CREATE resource:
      groups: "" => ["1", "2", "3"]

**Step 2:**

    groups = ["${computedvar}"]

The OLD behavior was:

    UPDATE resource
      groups.#: "3" => "computed"

This would cause a diff mismatch because if `${computedvar}` was
different then it should force new. The NEW behavior is:

    DESTROY/CREATE resource:
      groups.#: "3" => "computed" (forces new)
2016-11-15 11:02:14 -08:00
..
acctest tests: allow opt-out of remote tests via env var 2016-01-21 15:44:18 -06:00
config Fix failing tests 2014-10-09 21:29:21 -07:00
copy config/module: use the raw source as part of the key 2016-09-30 10:44:46 -07:00
diff helper/diff: handle unknownvariablevalue 2016-11-09 14:28:16 -08:00
experiment terraform: default new graphs on, old graphs behind -Xlegacy-graph 2016-11-10 21:53:20 -08:00
hashcode Return nonnegative hash if int is 32 bits 2016-07-01 14:40:53 -07:00
hilmapstructure core: Defeat backward compatibilty in mapstructure 2016-06-08 18:38:41 +01:00
logging Append to debug log files, don't clobber. 2016-10-18 13:08:23 -07:00
mutexkv provider/aws: serialize SG rule access to fix race condition 2015-11-18 12:39:59 -06:00
pathorcontents ssh: accept private key contents instead of path 2015-11-12 14:59:14 -06:00
resource helper/resource: remove StopCh, use contexts instead 2016-10-25 12:08:36 -07:00
schema helper/schema: mark diff as forcenew if element is computed 2016-11-15 11:02:14 -08:00
shadow helper/shadow: Close for auto-closing all values 2016-11-15 08:54:26 -08:00
signalwrapper providers/azurerm: cancellable storage account creation 2016-08-15 21:12:32 -07:00
validation helper: create validation package to provide common validation functions 2016-08-10 13:27:49 +01:00
wrappedreadline command: split out and tag code so compilation works on Solaris 2016-11-14 00:32:01 -08:00
wrappedstreams command: split out and tag code so compilation works on Solaris 2016-11-14 00:32:01 -08:00
README.md dos2unix 2014-07-28 10:43:00 -07:00

README.md

Helper Libraries

This folder contains helper libraries for Terraform plugins. A running joke is that this is "Terraform standard library" for plugins. The goal of the packages in this directory are to provide high-level helpers to make it easier to implement the various aspects of writing a plugin for Terraform.