Commit Graph

20 Commits

Author SHA1 Message Date
Paul Hinze e67fc0fe9b command: Change module-depth default to -1
This means that terraform commands like `plan`, `apply`, `show`, and
`graph` will expand all modules by default.

While modules-as-black-boxes is still very true in the conceptual design
of modules, feedback on this behavior has consistently suggested that
users would prefer to see more verbose output by default.

The `-module-depth` flag and env var are retained to allow output to be
optionally limited / summarized by these commands.
2016-01-20 13:58:02 -06:00
Radek Simko b7d41d2eed Add -no-color to help text 2015-06-22 13:14:01 +01:00
Paul Hinze 29d34cd5a4 command: allow module depth to be set via env var
Another convienence env var here with TF_MODULE_DEPTH.

Works like you'd expect it to!
2015-04-30 16:19:43 -05:00
Paul Hinze ce49dd6080 core: graph command gets -verbose and -draw-cycles
When you specify `-verbose` you'll get the whole graph of operations,
which gives a better idea of the operations terraform performs and in
what order.

The DOT graph is now generated with a small internal library instead of
simple string building. This allows us to ensure the graph generation is
as consistent as possible, among other benefits.

We set `newrank = true` in the graph, which I've found does just as good
a job organizing things visually as manually attempting to rank the nodes
based on depth.

This also fixes `-module-depth`, which was broken post-AST refector.
Modules are now expanded into subgraphs with labels and borders. We
have yet to regain the plan graphing functionality, so I removed that
from the docs for now.

Finally, if `-draw-cycles` is added, extra colored edges will be drawn
to indicate the path of any cycles detected in the graph.

A notable implementation change included here is that
{Reverse,}DepthFirstWalk has been made deterministic. (Before it was
dependent on `map` ordering.) This turned out to be unnecessary to gain
determinism in the final DOT-level implementation, but it seemed
a desirable enough of a property that I left it in.
2015-04-27 09:23:47 -05:00
Paul Hinze d4b9362518 core: validate on verbose graph to detect some cycles earlier
Most CBD-related cycles include destroy nodes, and destroy nodes were
all being pruned from the graph before staring the Validate walk.

In practice this meant that we had scenarios that would error out with
graph cycles on Apply that _seemed_ fine during Plan.

This introduces a Verbose option to the GraphBuilder that tells it to
generate a "worst-case" graph. Validate sets this to true so that cycle
errors will always trigger at this step if they're going to happen.

(This Verbose option will be exposed as a CLI flag to `terraform graph`
in a second incoming PR.)

refs #1651
2015-04-23 11:07:13 -05:00
Mitchell Hashimoto c2593f6ada terraform: re-enable dot-graphs 2015-02-19 23:00:29 -08:00
Mitchell Hashimoto b1e5b32322 terraform: Graph returns *Graph for now 2015-02-19 12:08:32 -08:00
Mitchell Hashimoto 72e6f97093 terraform: support graphing modules 2014-09-24 17:36:27 -07:00
Mitchell Hashimoto ed538a9594 command: Get command, not functional yet. Converted to use modules. 2014-09-22 10:56:50 -07:00
Mitchell Hashimoto 642fed0356 command: terraform.tfvars loaded by default if it exists 2014-08-05 09:32:01 -07:00
Mitchell Hashimoto ef6fba754d command: refactor so Context never plans 2014-07-26 17:51:15 -07:00
Mitchell Hashimoto 6c8c09c784 command/*: only Plan on the Apply 2014-07-14 11:48:03 -07:00
Mitchell Hashimoto ad3c0593a3 terraform: GraphDot 2014-07-14 11:34:52 -07:00
Mitchell Hashimoto 3a851bece0 command: convert all to use the new Meta thing 2014-07-12 20:37:30 -07:00
Mitchell Hashimoto 3d35158170 command: update synopsis to be better 2014-07-12 19:28:38 -07:00
Mitchell Hashimoto 8e100869a4 command/graph: can graph plans 2014-07-12 19:25:50 -07:00
Mitchell Hashimoto 235a253848 command/graph: no args means pwd 2014-07-11 20:41:47 -07:00
Mitchell Hashimoto 8f7244695f command/graph: takes config dir as arg 2014-07-11 20:38:03 -07:00
Mitchell Hashimoto a6ae7230d1 command: use new API 2014-07-03 11:46:40 -07:00
Mitchell Hashimoto 93fbb9ea8f command/graph 2014-07-01 10:02:13 -07:00