terraspace 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/aws/bin/build.sh +2 -0
  3. data/.cody/azurerm/bin/build.sh +2 -0
  4. data/.cody/google/bin/build.sh +2 -0
  5. data/CHANGELOG.md +38 -0
  6. data/README.md +2 -2
  7. data/lib/templates/base/project/README.md +1 -1
  8. data/lib/terraspace.rb +2 -0
  9. data/lib/terraspace/all/preview.rb +1 -1
  10. data/lib/terraspace/all/runner.rb +1 -0
  11. data/lib/terraspace/all/summary.rb +29 -2
  12. data/lib/terraspace/app.rb +9 -5
  13. data/lib/terraspace/builder.rb +11 -12
  14. data/lib/terraspace/cli.rb +33 -39
  15. data/lib/terraspace/cli/all.rb +15 -9
  16. data/lib/terraspace/cli/bundle.rb +2 -1
  17. data/lib/terraspace/cli/clean.rb +18 -6
  18. data/lib/terraspace/cli/clean/all.rb +18 -0
  19. data/lib/terraspace/cli/clean/base.rb +15 -0
  20. data/lib/terraspace/cli/clean/cache.rb +25 -0
  21. data/lib/terraspace/cli/{logs/tasks.rb → clean/logs.rb} +16 -5
  22. data/lib/terraspace/cli/cloud.rb +3 -9
  23. data/lib/terraspace/cli/cloud/runs.rb +0 -2
  24. data/lib/terraspace/cli/help/all/down.md +32 -0
  25. data/lib/terraspace/cli/help/all/graph.md +21 -0
  26. data/lib/terraspace/cli/help/all/output.md +22 -0
  27. data/lib/terraspace/cli/help/all/plan.md +25 -0
  28. data/lib/terraspace/cli/help/all/providers.md +21 -0
  29. data/lib/terraspace/cli/help/all/refresh.md +17 -0
  30. data/lib/terraspace/cli/help/all/show.md +21 -0
  31. data/lib/terraspace/cli/help/all/up.md +27 -0
  32. data/lib/terraspace/cli/help/all/validate.md +21 -0
  33. data/lib/terraspace/cli/help/build.md +6 -0
  34. data/lib/terraspace/cli/help/bundle.md +9 -5
  35. data/lib/terraspace/cli/help/check_setup.md +9 -0
  36. data/lib/terraspace/cli/help/clean/all.md +10 -0
  37. data/lib/terraspace/cli/help/clean/cache.md +12 -0
  38. data/lib/terraspace/cli/help/clean/logs.md +17 -0
  39. data/lib/terraspace/cli/help/cloud/destroy.md +16 -0
  40. data/lib/terraspace/cli/help/cloud/list.md +7 -0
  41. data/lib/terraspace/cli/help/cloud/runs/list.md +3 -3
  42. data/lib/terraspace/cli/help/cloud/runs/prune.md +2 -2
  43. data/lib/terraspace/cli/help/cloud/sync.md +26 -2
  44. data/lib/terraspace/cli/help/console.md +8 -0
  45. data/lib/terraspace/cli/help/down.md +26 -0
  46. data/lib/terraspace/cli/help/info.md +43 -0
  47. data/lib/terraspace/cli/help/init.md +37 -0
  48. data/lib/terraspace/cli/help/list.md +20 -0
  49. data/lib/terraspace/cli/help/logs.md +48 -0
  50. data/lib/terraspace/cli/help/logs/remove.md +5 -0
  51. data/lib/terraspace/cli/help/logs/truncate.md +5 -0
  52. data/lib/terraspace/cli/help/new/bootstrap_test.md +8 -0
  53. data/lib/terraspace/cli/help/new/example.md +8 -0
  54. data/lib/terraspace/cli/help/new/git_hook.md +6 -0
  55. data/lib/terraspace/cli/help/new/module.md +9 -0
  56. data/lib/terraspace/cli/help/new/module_test.md +12 -0
  57. data/lib/terraspace/cli/help/new/plugin.md +49 -0
  58. data/lib/terraspace/cli/help/new/project.md +40 -0
  59. data/lib/terraspace/cli/help/new/project_test.md +8 -0
  60. data/lib/terraspace/cli/help/new/shim.md +21 -0
  61. data/lib/terraspace/cli/help/new/stack.md +9 -0
  62. data/lib/terraspace/cli/help/output.md +6 -0
  63. data/lib/terraspace/cli/help/plan.md +29 -0
  64. data/lib/terraspace/cli/help/providers.md +18 -0
  65. data/lib/terraspace/cli/help/refresh.md +11 -0
  66. data/lib/terraspace/cli/help/seed.md +7 -0
  67. data/lib/terraspace/cli/help/show.md +36 -0
  68. data/lib/terraspace/cli/help/summary.md +11 -0
  69. data/lib/terraspace/cli/help/test.md +35 -0
  70. data/lib/terraspace/cli/help/up.md +30 -0
  71. data/lib/terraspace/cli/help/validate.md +9 -0
  72. data/lib/terraspace/cli/info.rb +4 -16
  73. data/lib/terraspace/cli/init.rb +3 -7
  74. data/lib/terraspace/cli/logs.rb +106 -9
  75. data/lib/terraspace/cli/{log → logs}/concern.rb +1 -1
  76. data/lib/terraspace/cli/new.rb +18 -18
  77. data/lib/terraspace/cli/new/git_hook.rb +4 -1
  78. data/lib/terraspace/cli/new/helper.rb +9 -2
  79. data/lib/terraspace/cli/new/project.rb +1 -1
  80. data/lib/terraspace/cli/summary.rb +2 -2
  81. data/lib/terraspace/command.rb +1 -1
  82. data/lib/terraspace/compiler/backend.rb +10 -0
  83. data/lib/terraspace/compiler/builder.rb +2 -1
  84. data/lib/terraspace/compiler/commands_concern.rb +18 -0
  85. data/lib/terraspace/compiler/dependencies/helpers.rb +34 -0
  86. data/lib/terraspace/compiler/dsl/syntax/helpers/common.rb +0 -26
  87. data/lib/terraspace/compiler/dsl/syntax/tfvar.rb +1 -0
  88. data/lib/terraspace/compiler/erb/context.rb +1 -1
  89. data/lib/terraspace/compiler/erb/helpers.rb +6 -0
  90. data/lib/terraspace/dependency/graph.rb +2 -1
  91. data/lib/terraspace/dependency/helper/base.rb +7 -0
  92. data/lib/terraspace/dependency/helper/depends_on.rb +12 -0
  93. data/lib/terraspace/dependency/helper/output.rb +11 -0
  94. data/lib/terraspace/hooks/builder.rb +52 -0
  95. data/lib/terraspace/hooks/concern.rb +9 -0
  96. data/lib/terraspace/{terraform/hooks → hooks}/dsl.rb +3 -2
  97. data/lib/terraspace/hooks/runner.rb +23 -0
  98. data/lib/terraspace/mod.rb +11 -2
  99. data/lib/terraspace/plugin/summary/interface.rb +4 -2
  100. data/lib/terraspace/shell.rb +50 -17
  101. data/lib/terraspace/terraform/args/custom.rb +1 -1
  102. data/lib/terraspace/terraform/cloud/runs/lister.rb +0 -2
  103. data/lib/terraspace/terraform/cloud/syncer.rb +2 -2
  104. data/lib/terraspace/terraform/cloud/workspace.rb +0 -9
  105. data/lib/terraspace/terraform/remote_state/fetcher.rb +37 -7
  106. data/lib/terraspace/terraform/remote_state/marker/output.rb +3 -1
  107. data/lib/terraspace/terraform/remote_state/output_proxy.rb +18 -14
  108. data/lib/terraspace/terraform/remote_state/unresolved.rb +40 -0
  109. data/lib/terraspace/terraform/runner.rb +2 -7
  110. data/lib/terraspace/version.rb +1 -1
  111. data/spec/fixtures/dependencies/app/stacks/a1/tfvars/dev.tfvars +1 -0
  112. data/spec/fixtures/fetcher/c1.json +4 -0
  113. data/spec/terraspace/all/summary_spec.rb +1 -1
  114. data/spec/terraspace/compiler/erb/render_spec.rb +15 -0
  115. data/spec/terraspace/dependency/helper/depends_on_spec.rb +27 -0
  116. data/spec/terraspace/dependency/helper/output_spec.rb +29 -0
  117. data/spec/terraspace/{terraform/hooks → hooks}/builder_spec.rb +4 -5
  118. data/spec/terraspace/terraform/remote_state/fetcher_spec.rb +108 -27
  119. data/spec/terraspace/terraform/remote_state/marker/output_spec.rb +36 -0
  120. data/spec/terraspace/terraform/remote_state/output_proxy_spec.rb +69 -0
  121. data/terraspace.gemspec +1 -1
  122. metadata +78 -13
  123. data/lib/terraspace/cli/help/log.md +0 -42
  124. data/lib/terraspace/cli/help/update.md +0 -5
  125. data/lib/terraspace/cli/log.rb +0 -112
  126. data/lib/terraspace/terraform/hooks/builder.rb +0 -40
@@ -3,14 +3,14 @@ class Terraspace::CLI
3
3
  class_option :yes, aliases: :y, type: :boolean, desc: "auto approve all batch commands"
4
4
  class_option :exit_on_fail, type: :boolean, desc: "whether or not to exit when one of the batch commands fails"
5
5
 
6
- desc "down", "destroy all"
6
+ desc "down", "Destroy all or multiple stacks."
7
7
  long_desc Help.text("all/down")
8
8
  option :destroy_workspace, type: :boolean, desc: "Also destroy the Cloud workspace. Only applies when using Terraform Cloud remote backend."
9
9
  def down(*stacks)
10
10
  Terraspace::All::Runner.new("down", @options.merge(stacks: stacks)).run
11
11
  end
12
12
 
13
- desc "graph", "graph all"
13
+ desc "graph", "Draw a dependency graph."
14
14
  long_desc Help.text("all/graph")
15
15
  option :format, default: "png", desc: "format: text or diagram"
16
16
  option :full,type: :boolean, desc: "draw the full graph with highlighted nodes or draw the subgraph. text format defaults to false, graph format defaults to true"
@@ -18,43 +18,49 @@ class Terraspace::CLI
18
18
  Terraspace::All::Grapher.new(@options.merge(stacks: stacks)).run
19
19
  end
20
20
 
21
- desc "refresh", "refresh all"
21
+ desc "init", "Init."
22
+ long_desc Help.text("all/init")
23
+ def init(*stacks)
24
+ Terraspace::All::Runner.new("init", @options.merge(stacks: stacks)).run
25
+ end
26
+
27
+ desc "refresh", "Refresh all or multiple stacks."
22
28
  long_desc Help.text("all/refresh")
23
29
  def refresh(*stacks)
24
30
  Terraspace::All::Runner.new("refresh", @options.merge(stacks: stacks)).run
25
31
  end
26
32
 
27
- desc "output", "output all"
33
+ desc "output", "Show output for all or multiple stacks."
28
34
  long_desc Help.text("all/output")
29
35
  def output(*stacks)
30
36
  Terraspace::All::Runner.new("output", @options.merge(stacks: stacks)).run
31
37
  end
32
38
 
33
- desc "plan", "plan all"
39
+ desc "plan", "Run plan for all or multiple stacks."
34
40
  long_desc Help.text("all/plan")
35
41
  def plan(*stacks)
36
42
  Terraspace::All::Runner.new("plan", @options.merge(stacks: stacks)).run
37
43
  end
38
44
 
39
- desc "providers", "providers all"
45
+ desc "providers", "Show providers for all or multiple stacks."
40
46
  long_desc Help.text("all/providers")
41
47
  def providers(*stacks)
42
48
  Terraspace::All::Runner.new("providers", @options.merge(stacks: stacks)).run
43
49
  end
44
50
 
45
- desc "show", "show all"
51
+ desc "show", "Run show for all or multiple stacks."
46
52
  long_desc Help.text("all/show")
47
53
  def show(*stacks)
48
54
  Terraspace::All::Runner.new("show", @options.merge(stacks: stacks)).run
49
55
  end
50
56
 
51
- desc "up", "deploy all"
57
+ desc "up", "Deploy all or multiple stacks."
52
58
  long_desc Help.text("all/up")
53
59
  def up(*stacks)
54
60
  Terraspace::All::Runner.new("up", @options.merge(stacks: stacks)).run
55
61
  end
56
62
 
57
- desc "validate", "validate all"
63
+ desc "validate", "Validate all or multiple stacks."
58
64
  long_desc Help.text("all/validate")
59
65
  def validate(*stacks)
60
66
  Terraspace::All::Runner.new("validate", @options.merge(stacks: stacks)).run
@@ -1,5 +1,4 @@
1
1
  require "terraspace-bundler"
2
- TerraspaceBundler.config.logger = Terraspace.logger
3
2
 
4
3
  class Terraspace::CLI
5
4
  class Bundle
@@ -8,6 +7,8 @@ class Terraspace::CLI
8
7
  end
9
8
 
10
9
  def run
10
+ Terraspace.check_project!
11
+ TerraspaceBundler.config.deep_merge!(Terraspace.config.bundle)
11
12
  TerraspaceBundler::CLI.start(args)
12
13
  end
13
14
 
@@ -1,12 +1,24 @@
1
1
  class Terraspace::CLI
2
- class Clean
3
- def initialize(options={})
4
- @options = options
2
+ class Clean < Terraspace::Command
3
+ class_option :yes, aliases: :y, type: :boolean, desc: "bypass are you sure prompt"
4
+
5
+ desc "all", "Runs all clean operations."
6
+ long_desc Help.text("clean/all")
7
+ def all
8
+ All.new(options).run
9
+ end
10
+
11
+ desc "cache", "Removes cache dirs."
12
+ long_desc Help.text("clean/cache")
13
+ def cache
14
+ Cache.new(options).run
5
15
  end
6
16
 
7
- def run
8
- FileUtils.rm_rf(Terraspace.cache_root)
9
- puts "Removed #{Terraspace::Util.pretty_path(Terraspace.cache_root)}"
17
+ desc "logs", "Removes or truncate logs."
18
+ long_desc Help.text("clean/logs")
19
+ option :truncate, aliases: :t, type: :boolean, desc: "Truncate instead of remove logs"
20
+ def logs
21
+ Logs.new(options).run
10
22
  end
11
23
  end
12
24
  end
@@ -0,0 +1,18 @@
1
+ class Terraspace::CLI::Clean
2
+ class All < Base
3
+ def run
4
+ are_you_sure?
5
+ o = @options.merge(yes: true) # override to avoid double prompt
6
+ Cache.new(o).run
7
+ Logs.new(o).run
8
+ end
9
+
10
+ def are_you_sure?
11
+ message = <<~EOL.chomp
12
+ Will remove Terraspace cache and logs.
13
+ Are you sure?
14
+ EOL
15
+ sure?(message) # from Util::Sure
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ class Terraspace::CLI::Clean
2
+ class Base
3
+ include Terraspace::Util::Logging
4
+ include Terraspace::Util::Sure
5
+
6
+ def initialize(options={})
7
+ @options = options
8
+ Terraspace.check_project!
9
+ end
10
+
11
+ def pretty(path)
12
+ Terraspace::Util.pretty_path(path)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,25 @@
1
+ class Terraspace::CLI::Clean
2
+ class Cache < Base
3
+ def run
4
+ Terraspace.check_project!
5
+ paths = [Terraspace.cache_root, Terraspace.tmp_root]
6
+ are_you_sure?(paths)
7
+ paths.each do |path|
8
+ FileUtils.rm_rf(path)
9
+ puts "Removed #{pretty(path)}"
10
+ end
11
+ end
12
+
13
+ def are_you_sure?(paths)
14
+ pretty_paths = paths.map { |p| " #{pretty(p)}" }.join("\n")
15
+ message = <<~EOL.chomp
16
+ Will remove these folders and all their files:
17
+
18
+ #{pretty_paths}
19
+
20
+ Are you sure?
21
+ EOL
22
+ sure?(message) # from Util::Sure
23
+ end
24
+ end
25
+ end
@@ -1,11 +1,13 @@
1
- class Terraspace::CLI::Logs
2
- class Tasks
3
- def initialize(options={})
4
- @options = options
1
+ class Terraspace::CLI::Clean
2
+ class Logs < Base
3
+ def run
4
+ action = @options[:truncate] ? "truncate" : "remove"
5
+ are_you_sure?(action)
6
+ @options[:truncate] ? truncate : remove
7
+ logger.info "Logs #{action}d" # IE: Logs truncated or Logs removed
5
8
  end
6
9
 
7
10
  def truncate
8
- puts "Truncating log files in #{pretty_log_root}/" unless @options[:mute]
9
11
  log_files.each do |path|
10
12
  File.open(path, "w").close # truncates files
11
13
  end
@@ -28,5 +30,14 @@ class Terraspace::CLI::Logs
28
30
  def log_root
29
31
  Terraspace.config.log.root
30
32
  end
33
+
34
+ def are_you_sure?(action)
35
+ message = <<~EOL.chomp
36
+ Will #{action} all the log files in #{pretty_log_root}/ folder
37
+ Are you sure?
38
+ EOL
39
+ sure?(message) # from Util::Sure
40
+ end
31
41
  end
32
42
  end
43
+
@@ -20,17 +20,11 @@ class Terraspace::CLI
20
20
  Workspace.new(options.merge(mod: mod)).destroy
21
21
  end
22
22
 
23
- desc "setup STACK", "Setup workspace"
24
- long_desc Help.text("cloud:setup")
25
- def setup(mod)
26
- Workspace.new(options.merge(mod: mod)).setup
27
- end
28
-
29
- desc "sync [STACK]", "sync workspace"
23
+ desc "sync [STACK]", "Sync all or multiple workspaces."
30
24
  long_desc Help.text("cloud:sync")
31
25
  yes_option.call
32
- def sync(mod=nil)
33
- Syncer.new(options.merge(mod: mod, override_auto_sync: true)).run
26
+ def sync(*stacks)
27
+ Syncer.new(options.merge(stacks: stacks, override_auto_sync: true)).run
34
28
  end
35
29
 
36
30
  desc "runs SUBCOMMAND", "runs subcommands"
@@ -1,5 +1,3 @@
1
- require 'cli-format'
2
-
3
1
  class Terraspace::CLI::Cloud
4
2
  class Runs < Terraspace::Command
5
3
  Help = Terraspace::CLI::Help
@@ -0,0 +1,32 @@
1
+ ## Example
2
+
3
+ $ terraspace all down
4
+ Will run:
5
+ terraspace down a1 # batch 1
6
+ terraspace down b1 # batch 2
7
+ terraspace down b2 # batch 2
8
+ terraspace down c1 # batch 3
9
+ Are you sure? (y/N)
10
+
11
+ Once you confirm, Terraspace destroys the infrastructure.
12
+
13
+ Are you sure? (y/N) y
14
+ Batch Run 1:
15
+ Running: terraspace down a1 Logs: log/down/a1.log
16
+ terraspace down a1: Changes to Outputs:
17
+ terraspace down a1: Destroy complete! Resources: 2 destroyed.
18
+ Batch Run 2:
19
+ Running: terraspace down b1 Logs: log/down/b1.log
20
+ Running: terraspace down b2 Logs: log/down/b2.log
21
+ terraspace down b1: Changes to Outputs:
22
+ terraspace down b1: Destroy complete! Resources: 2 destroyed.
23
+ terraspace down b2: Changes to Outputs:
24
+ terraspace down b2: Destroy complete! Resources: 1 destroyed.
25
+ Batch Run 3:
26
+ Running: terraspace down c1 Logs: log/down/c1.log
27
+ terraspace down c1: Changes to Outputs:
28
+ terraspace down c1: Destroy complete! Resources: 1 destroyed.
29
+ Time took: 15s
30
+ $
31
+
32
+ Terraspace provides a reduced-noise summary of the runs. The full logs are also written for further inspection and debugging. The [terraspace log](https://terraspace.cloud/reference/terraspace-log/) command is useful for viewing the logs.
@@ -0,0 +1,21 @@
1
+ ## Example
2
+
3
+ $ terraspace all graph
4
+ Building graph...
5
+ Graph saved to .terraspace-cache/graph/dependencies-20200919192103.png
6
+ $
7
+
8
+ The graph will auto-open on macosx and cloud9.
9
+
10
+ ![](https://img.boltops.com/boltops/tools/terraspace/graphs/example-a1.png)
11
+
12
+ ## Text Form
13
+
14
+ You can also generate a graph in text, tree-like form
15
+
16
+ $ terraspace all graph --format text
17
+ a1
18
+ ├── b2
19
+ │ └── c1
20
+ └── b1
21
+ └── c1
@@ -0,0 +1,22 @@
1
+ ## Example
2
+
3
+ $ terraspace all output
4
+ Running:
5
+ terraspace output c1 # batch 1
6
+ terraspace output b1 # batch 2
7
+ terraspace output b2 # batch 2
8
+ terraspace output a1 # batch 3
9
+ Batch Run 1:
10
+ Running: terraspace output c1 Logs: log/output/c1.log
11
+ terraspace output c1: length = 1
12
+ Batch Run 2:
13
+ Running: terraspace output b1 Logs: log/output/b1.log
14
+ Running: terraspace output b2 Logs: log/output/b2.log
15
+ terraspace output b1: length = 1
16
+ terraspace output b1: length2 = 1
17
+ terraspace output b2: length = 1
18
+ Batch Run 3:
19
+ Running: terraspace output a1 Logs: log/output/a1.log
20
+ terraspace output a1: Warning: No outputs found
21
+ Time took: 12s
22
+ $
@@ -0,0 +1,25 @@
1
+ ## Example
2
+
3
+ $ terraspace all plan
4
+ Running:
5
+ terraspace plan c1 # batch 1
6
+ terraspace plan b1 # batch 2
7
+ terraspace plan b2 # batch 2
8
+ terraspace plan a1 # batch 3
9
+ Batch Run 1:
10
+ Running: terraspace plan c1 Logs: log/plan/c1.log
11
+ terraspace plan c1: Plan: 1 to add, 0 to change, 0 to destroy.
12
+ terraspace plan c1: Changes to Outputs:
13
+ Batch Run 2:
14
+ Running: terraspace plan b1 Logs: log/plan/b1.log
15
+ Running: terraspace plan b2 Logs: log/plan/b2.log
16
+ terraspace plan b1: Plan: 2 to add, 0 to change, 0 to destroy.
17
+ terraspace plan b1: Changes to Outputs:
18
+ terraspace plan b2: Plan: 1 to add, 0 to change, 0 to destroy.
19
+ terraspace plan b2: Changes to Outputs:
20
+ Batch Run 3:
21
+ Running: terraspace plan a1 Logs: log/plan/a1.log
22
+ terraspace plan a1: Plan: 2 to add, 0 to change, 0 to destroy.
23
+ terraspace plan a1: Changes to Outputs:
24
+ Time took: 11s
25
+ $
@@ -0,0 +1,21 @@
1
+ ## Example
2
+
3
+ $ terraspace all providers
4
+ Running:
5
+ terraspace providers c1 # batch 1
6
+ terraspace providers b1 # batch 2
7
+ terraspace providers b2 # batch 2
8
+ terraspace providers a1 # batch 3
9
+ Batch Run 1:
10
+ Running: terraspace providers c1 Logs: log/providers/c1.log
11
+ terraspace providers c1: └── provider[registry.terraform.io/hashicorp/random]
12
+ Batch Run 2:
13
+ Running: terraspace providers b1 Logs: log/providers/b1.log
14
+ Running: terraspace providers b2 Logs: log/providers/b2.log
15
+ terraspace providers b1: └── provider[registry.terraform.io/hashicorp/random]
16
+ terraspace providers b2: └── provider[registry.terraform.io/hashicorp/random]
17
+ Batch Run 3:
18
+ Running: terraspace providers a1 Logs: log/providers/a1.log
19
+ terraspace providers a1: └── provider[registry.terraform.io/hashicorp/random]
20
+ Time took: 9s
21
+ $
@@ -0,0 +1,17 @@
1
+ ## Example
2
+
3
+ $ terraspace all refresh
4
+ Running:
5
+ terraspace refresh c1 # batch 1
6
+ terraspace refresh b1 # batch 2
7
+ terraspace refresh b2 # batch 2
8
+ terraspace refresh a1 # batch 3
9
+ Batch Run 1:
10
+ Running: terraspace refresh c1 Logs: log/refresh/c1.log
11
+ Batch Run 2:
12
+ Running: terraspace refresh b1 Logs: log/refresh/b1.log
13
+ Running: terraspace refresh b2 Logs: log/refresh/b2.log
14
+ Batch Run 3:
15
+ Running: terraspace refresh a1 Logs: log/refresh/a1.log
16
+ Time took: 11s
17
+ $
@@ -0,0 +1,21 @@
1
+ ## Example
2
+
3
+ $ terraspace all show
4
+ Running:
5
+ terraspace show c1 # batch 1
6
+ terraspace show b1 # batch 2
7
+ terraspace show b2 # batch 2
8
+ terraspace show a1 # batch 3
9
+ Batch Run 1:
10
+ Running: terraspace show c1 Logs: log/show/c1.log
11
+ terraspace show c1: Resources: 0 Outputs: 1
12
+ Batch Run 2:
13
+ Running: terraspace show b1 Logs: log/show/b1.log
14
+ Running: terraspace show b2 Logs: log/show/b2.log
15
+ terraspace show b1: Resources: 0 Outputs: 2
16
+ terraspace show b2: Resources: 0 Outputs: 1
17
+ Batch Run 3:
18
+ Running: terraspace show a1 Logs: log/show/a1.log
19
+ terraspace show a1: Resources: 0 Outputs: 0
20
+ Time took: 12s
21
+ $
@@ -0,0 +1,27 @@
1
+ ## Example
2
+
3
+ $ terraspace all up
4
+ Will run:
5
+ terraspace up c1 # batch 1
6
+ terraspace up b1 # batch 2
7
+ terraspace up b2 # batch 2
8
+ terraspace up a1 # batch 3
9
+ Are you sure? (y/N)
10
+
11
+ Once you confirm, Terraspace deploys the batches in parallel. Essentially, Terraspace handles the orchestration.
12
+
13
+ Are you sure? (y/N) y
14
+ Batch Run 1:
15
+ Running: terraspace up c1 Logs: log/up/c1.log
16
+ terraspace up c1: Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
17
+ Batch Run 2:
18
+ Running: terraspace up b1 Logs: log/up/b1.log
19
+ Running: terraspace up b2 Logs: log/up/b2.log
20
+ terraspace up b1: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
21
+ terraspace up b2: Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
22
+ Batch Run 3:
23
+ Running: terraspace up a1 Logs: log/up/a1.log
24
+ terraspace up a1: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
25
+ Time took: 25s
26
+
27
+ Terraspace provides a reduced-noise summary of the runs. The full logs are also written for further inspection and debugging. The [terraspace log](https://terraspace.cloud/reference/terraspace-log/) command is useful for viewing the logs.
@@ -0,0 +1,21 @@
1
+ ## Example
2
+
3
+ $ terraspace all validate
4
+ Running:
5
+ terraspace validate c1 # batch 1
6
+ terraspace validate b1 # batch 2
7
+ terraspace validate b2 # batch 2
8
+ terraspace validate a1 # batch 3
9
+ Batch Run 1:
10
+ Running: terraspace validate c1 Logs: log/validate/c1.log
11
+ terraspace validate c1: Success! The configuration is valid.
12
+ Batch Run 2:
13
+ Running: terraspace validate b1 Logs: log/validate/b1.log
14
+ Running: terraspace validate b2 Logs: log/validate/b2.log
15
+ terraspace validate b1: Success! The configuration is valid.
16
+ terraspace validate b2: Success! The configuration is valid.
17
+ Batch Run 3:
18
+ Running: terraspace validate a1 Logs: log/validate/a1.log
19
+ terraspace validate a1: Success! The configuration is valid.
20
+ Time took: 13s
21
+ $