Commit Graph

1502 Commits

Author SHA1 Message Date
Mitchell Hashimoto
0c271b2b2d
terraform: better detection of unknown values in ResourceConfig, tests 2016-11-09 14:28:15 -08:00
Mitchell Hashimoto
9cc5e81a6c
terraform: add tests for IsComputed that pass on master 2016-11-09 14:28:15 -08:00
Mitchell Hashimoto
5ed1b5fc89
terraform: use the new TypeUnknown type from HIL
This makes all the computed stuff "just work" since HIL uses the same
computed sentinel value (string UUID) and the type differentiates it
from a regular string.
2016-11-09 14:28:15 -08:00
James Bardin
f7d6fb368a
Add failing test for missing computed map entries
The map output from the module "mod" loses the computed value from the
template when we validate. If the "extra" field is removed from the map,
the validation fails earlier with map "does not have any elements so
cannot determine type".

Apply will work, because the computed value will exist in the map.
2016-11-09 14:28:15 -08:00
Mitchell Hashimoto
66ccc19d94 Merge pull request #9973 from hashicorp/f-new-plan
terraform: new plan graph
2016-11-09 08:15:40 -08:00
Mitchell Hashimoto
fa195d4faf
terraform: fix a typo found during review 2016-11-09 08:10:09 -08:00
Mitchell Hashimoto
9e0af96afa Merge pull request #9971 from hashicorp/b-orphan-output
terraform: prune orphan outputs in old graph
2016-11-09 07:53:15 -08:00
Mitchell Hashimoto
2b7177cfe7 Merge pull request #9607 from hashicorp/f-provider-stop-redo
terraform: ResourceProvider.Stop (redo)
2016-11-08 15:58:48 -08:00
Mitchell Hashimoto
261f0ee592 Merge pull request #9698 from hashicorp/b-simple-var
terraform: disallow simple variables ("foo")
2016-11-08 15:30:31 -08:00
Mitchell Hashimoto
838fe2af9b
terraform: address go vet 2016-11-08 14:04:57 -08:00
Mitchell Hashimoto
bcc67fd135
terraform: uncomment a test that we were waiting on
terraform: remove final TODO
2016-11-08 13:59:31 -08:00
Mitchell Hashimoto
19350d617d
terraform: references can have backups
terraform: more specific resource references

terraform: outputs need to know about the new reference format

terraform: resources w/o a config still have a referencable name
2016-11-08 13:59:30 -08:00
Mitchell Hashimoto
c0d2493156
terraform: remove a complete TODO 2016-11-08 13:59:30 -08:00
Mitchell Hashimoto
337abe3f62
terraform: enable plan shadow graph 2016-11-08 13:59:30 -08:00
Mitchell Hashimoto
1efdba9b30
terraform: target at the right moment to get the right values 2016-11-08 13:59:30 -08:00
Mitchell Hashimoto
bb9820cc0b
terraform: enable targeting on expanded nodes 2016-11-08 13:59:29 -08:00
Mitchell Hashimoto
d29844969a
terraform: test fixture needs to use variable so its not pruned 2016-11-08 13:59:29 -08:00
Mitchell Hashimoto
f6df1edeb4
terraform: proper "what to orphan" on zero/one boundary logic 2016-11-08 13:59:29 -08:00
Mitchell Hashimoto
f95f904ba8
terraform: add TargetsTransformer to plan 2016-11-08 13:59:29 -08:00
Mitchell Hashimoto
a2d71388c2
terraform: output the exact instance for prevent destroy on count 2016-11-08 13:59:28 -08:00
Mitchell Hashimoto
e6be4fefe8
terraform: reference an output so it isn't pruned during plan 2016-11-08 13:59:28 -08:00
Mitchell Hashimoto
6914d605c8
terraform: connect references 2016-11-08 13:59:28 -08:00
Mitchell Hashimoto
091264e4ba
terraform: OrphanResourceCountTransformer for orphaning extranneous
instances
2016-11-08 13:59:27 -08:00
Mitchell Hashimoto
97b7915b8f
terraform: fix zero/one boundary for resource counts 2016-11-08 13:59:27 -08:00
Mitchell Hashimoto
bd8802e08d
terraform: plan orphan destruction 2016-11-08 13:59:27 -08:00
Mitchell Hashimoto
2608c5f282
terraform: transform for adding orphan resources + tests 2016-11-08 13:59:27 -08:00
Mitchell Hashimoto
6337829786
terraform: expand count in plan 2016-11-08 13:59:26 -08:00
Mitchell Hashimoto
4cdaf6f687
terraform: ResourceTransformer to ResourceTransformerOld 2016-11-08 13:59:26 -08:00
Mitchell Hashimoto
d7aa59be3c
terraform: begin NodePlannableResource 2016-11-08 13:59:26 -08:00
Mitchell Hashimoto
dbac0785bc
terraform: tests for the plan graph builder 2016-11-08 13:59:26 -08:00
Mitchell Hashimoto
7557e6e70a
terraform: ConfigTransformer 2016-11-08 13:59:25 -08:00
Mitchell Hashimoto
4f0d68dda4
terraform: PlanGraphBuilder 2016-11-08 13:59:17 -08:00
Mitchell Hashimoto
ce4ff06d25
terraform: prepare Plan for shadowing 2016-11-08 13:28:50 -08:00
Mitchell Hashimoto
f9fee4106f
terraform: Diff.Prune 2016-11-08 13:28:50 -08:00
Mitchell Hashimoto
9890a2ee91
terraform: prune orphan outputs in old graph
This makes the old graph also prune orphan outputs in modules.
This will fix shadow graph errors such as #9905 since the old graph will
also behave correctly in these scenarios.

Luckily, because orphan outputs don't rely on anything, we were able to
simply use the same transformer!
2016-11-08 13:24:09 -08:00
Mitchell Hashimoto
fb29b6a2dc
terraform: destroy edges should never point to self
Fixes #9920

This was an issue caught with the shadow graph. Self references in
provisioners were causing a self-edge on destroy apply graphs.

We need to explicitly check that we're not creating an edge to ourself.
This is also how the reference transformer works.
2016-11-08 12:27:33 -08:00
Mitchell Hashimoto
f580a8ed7b Merge pull request #9894 from hashicorp/b-provider-alias
terraform: configure provider aliases in the new apply graph
2016-11-07 07:59:33 -08:00
Mitchell Hashimoto
1beda4cd07 Merge pull request #9898 from hashicorp/b-new-ref-existing
terraform: remove pruning of module vars if they ref non-existing nodes
2016-11-07 07:59:25 -08:00
Mitchell Hashimoto
a5df3973a4
terraform: module variables should be pruned if nothing depends on them 2016-11-04 18:58:03 -07:00
Mitchell Hashimoto
b488e51f56
terraform: tests for ReferenceMap.References 2016-11-04 18:40:09 -07:00
Mitchell Hashimoto
b7954a42fe
terraform: remove pruning of module vars if they ref non-existing nodes
Fixes a shadow graph error found during usage.

The new apply graph was only adding module variables that referenced
data that existed _in the graph_. This isn't a valid optimization since
the data it is referencing may be in the state with no diff, and
therefore available but not in the graph.

This just removes that optimization logic, which causes no failing
tests. It also adds a test that exposes the bug if we had the pruning
logic.
2016-11-04 17:47:20 -07:00
Mitchell Hashimoto
d7ed6637c1
terraform: configure provider aliases in the new apply graph
Found via a shadow graph failure:

Provider aliases weren't being configured by the new apply graph.

This was caused by the transform that attaches configs to provider nodes
not being able to handle aliases and therefore not attaching a config.
Added a test to this and fixed it.
2016-11-04 16:51:52 -07:00
Mitchell Hashimoto
944ffdb95b
terraform: multi-var ordering is by count
Fixes #9444

This appears to be a regression from 0.7.0, but there were no tests
covering it so we missed it and changed the behavior at some point! Oh
no.

This PR make the ordering of multi-var access: `resource.name.*.attr`
consistent: it is the ordering of the count, not the lexical ordering of
the value. This allows behavior where two lists are indexed by count
index and can be assumed to be related (for example user data for an aws
instance, as shown in the above referenced issue).

Two new context tests added to cover this case.
2016-11-04 11:07:01 -07:00
Mitchell Hashimoto
38314186f1
release: cleanup after v0.7.9 2016-11-04 09:39:49 -07:00
Mitchell Hashimoto
b313e55fe7
v0.7.9 2016-11-04 16:31:49 +00:00
Mitchell Hashimoto
57c0cadc79 Merge pull request #9666 from hashicorp/jbardin/debug
preliminary debug output
2016-11-04 09:03:58 -07:00
James Bardin
60873827da re-add "Graph after..." logs 2016-11-04 12:03:16 -04:00
Mitchell Hashimoto
f6dacab0ba Merge pull request #9794 from hashicorp/b-partial-input
command/meta: always ask for unset variable input
2016-11-04 08:48:05 -07:00
James Bardin
1cea51a9fa Record walk order in the debug graph
Insert the walk order into the graph labels. Removed some extra debug
output.
2016-11-04 11:39:46 -04:00
James Bardin
354f04f104 Add some basic tests
Also make DebugHook noop when there is no debuginfo set
2016-11-04 11:39:46 -04:00