terraspace 0.2.4 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) 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 +39 -1
  6. data/README.md +14 -1
  7. data/lib/templates/base/git_hook/hook.sh +1 -1
  8. data/lib/templates/base/project/.gitignore +1 -0
  9. data/lib/templates/base/project/README.md +17 -0
  10. data/lib/terraspace.rb +6 -0
  11. data/lib/terraspace/all/base.rb +8 -0
  12. data/lib/terraspace/all/grapher.rb +129 -0
  13. data/lib/terraspace/all/preview.rb +43 -0
  14. data/lib/terraspace/all/runner.rb +169 -0
  15. data/lib/terraspace/all/summary.rb +119 -0
  16. data/lib/terraspace/app.rb +31 -9
  17. data/lib/terraspace/booter.rb +9 -0
  18. data/lib/terraspace/builder.rb +59 -22
  19. data/lib/terraspace/cli.rb +60 -33
  20. data/lib/terraspace/cli/all.rb +63 -0
  21. data/lib/terraspace/cli/build/placeholder.rb +2 -5
  22. data/lib/terraspace/cli/bundle.rb +1 -1
  23. data/lib/terraspace/cli/check_setup.rb +5 -0
  24. data/lib/terraspace/cli/cloud.rb +16 -6
  25. data/lib/terraspace/cli/cloud/runs.rb +22 -0
  26. data/lib/terraspace/cli/commander.rb +1 -8
  27. data/lib/terraspace/cli/down.rb +20 -0
  28. data/lib/terraspace/cli/help/all/down.md +32 -0
  29. data/lib/terraspace/cli/help/all/graph.md +21 -0
  30. data/lib/terraspace/cli/help/all/output.md +22 -0
  31. data/lib/terraspace/cli/help/all/plan.md +25 -0
  32. data/lib/terraspace/cli/help/all/providers.md +21 -0
  33. data/lib/terraspace/cli/help/all/refresh.md +17 -0
  34. data/lib/terraspace/cli/help/all/show.md +21 -0
  35. data/lib/terraspace/cli/help/all/up.md +27 -0
  36. data/lib/terraspace/cli/help/all/validate.md +21 -0
  37. data/lib/terraspace/cli/help/build.md +6 -0
  38. data/lib/terraspace/cli/help/bundle.md +9 -5
  39. data/lib/terraspace/cli/help/check_setup.md +9 -0
  40. data/lib/terraspace/cli/help/clean.md +5 -0
  41. data/lib/terraspace/cli/help/cloud/destroy.md +16 -0
  42. data/lib/terraspace/cli/help/cloud/list.md +7 -0
  43. data/lib/terraspace/cli/help/cloud/runs/list.md +36 -0
  44. data/lib/terraspace/cli/help/cloud/runs/prune.md +25 -0
  45. data/lib/terraspace/cli/help/cloud/sync.md +43 -0
  46. data/lib/terraspace/cli/help/console.md +8 -0
  47. data/lib/terraspace/cli/help/down.md +26 -0
  48. data/lib/terraspace/cli/help/info.md +43 -0
  49. data/lib/terraspace/cli/help/init.md +37 -0
  50. data/lib/terraspace/cli/help/list.md +20 -0
  51. data/lib/terraspace/cli/help/log.md +48 -0
  52. data/lib/terraspace/cli/help/logs/remove.md +5 -0
  53. data/lib/terraspace/cli/help/logs/truncate.md +5 -0
  54. data/lib/terraspace/cli/help/new/bootstrap_test.md +8 -0
  55. data/lib/terraspace/cli/help/new/example.md +8 -0
  56. data/lib/terraspace/cli/help/new/git_hook.md +6 -0
  57. data/lib/terraspace/cli/help/new/module.md +9 -0
  58. data/lib/terraspace/cli/help/new/module_test.md +12 -0
  59. data/lib/terraspace/cli/help/new/plugin.md +49 -0
  60. data/lib/terraspace/cli/help/new/project.md +40 -0
  61. data/lib/terraspace/cli/help/new/project_test.md +8 -0
  62. data/lib/terraspace/cli/help/new/shim.md +21 -0
  63. data/lib/terraspace/cli/help/new/stack.md +9 -0
  64. data/lib/terraspace/cli/help/output.md +6 -0
  65. data/lib/terraspace/cli/help/plan.md +29 -0
  66. data/lib/terraspace/cli/help/providers.md +18 -0
  67. data/lib/terraspace/cli/help/refresh.md +11 -0
  68. data/lib/terraspace/cli/help/seed.md +7 -0
  69. data/lib/terraspace/cli/help/show.md +36 -0
  70. data/lib/terraspace/cli/help/summary.md +11 -0
  71. data/lib/terraspace/cli/help/test.md +35 -0
  72. data/lib/terraspace/cli/help/up.md +30 -0
  73. data/lib/terraspace/cli/help/validate.md +9 -0
  74. data/lib/terraspace/cli/info.rb +4 -16
  75. data/lib/terraspace/cli/init.rb +35 -7
  76. data/lib/terraspace/cli/list.rb +14 -1
  77. data/lib/terraspace/cli/log.rb +112 -0
  78. data/lib/terraspace/cli/log/concern.rb +24 -0
  79. data/lib/terraspace/cli/logs.rb +15 -0
  80. data/lib/terraspace/cli/logs/tasks.rb +32 -0
  81. data/lib/terraspace/cli/new.rb +18 -18
  82. data/lib/terraspace/cli/new/git_hook.rb +5 -2
  83. data/lib/terraspace/cli/new/project.rb +1 -1
  84. data/lib/terraspace/cli/summary.rb +2 -2
  85. data/lib/terraspace/cli/tfc_concern.rb +14 -0
  86. data/lib/terraspace/cli/up.rb +32 -0
  87. data/lib/terraspace/command.rb +1 -1
  88. data/lib/terraspace/compiler/backend.rb +10 -0
  89. data/lib/terraspace/compiler/builder.rb +5 -4
  90. data/lib/terraspace/compiler/cleaner.rb +1 -1
  91. data/lib/terraspace/compiler/cleaner/backend_change.rb +21 -7
  92. data/lib/terraspace/compiler/commands_concern.rb +18 -0
  93. data/lib/terraspace/compiler/dirs_concern.rb +47 -0
  94. data/lib/terraspace/compiler/dsl/syntax/helpers/common.rb +26 -1
  95. data/lib/terraspace/core.rb +11 -2
  96. data/lib/terraspace/dependency/graph.rb +140 -0
  97. data/lib/terraspace/dependency/node.rb +38 -0
  98. data/lib/terraspace/dependency/registry.rb +11 -0
  99. data/lib/terraspace/logger.rb +6 -18
  100. data/lib/terraspace/logger/formatter.rb +13 -0
  101. data/lib/terraspace/mod.rb +7 -1
  102. data/lib/terraspace/plugin/summary/interface.rb +1 -1
  103. data/lib/terraspace/seeder/where.rb +6 -2
  104. data/lib/terraspace/shell.rb +107 -0
  105. data/lib/terraspace/terraform/api.rb +7 -45
  106. data/lib/terraspace/terraform/api/base.rb +7 -0
  107. data/lib/terraspace/terraform/api/client.rb +23 -3
  108. data/lib/terraspace/terraform/api/http.rb +14 -34
  109. data/lib/terraspace/terraform/api/http/concern.rb +10 -0
  110. data/lib/terraspace/terraform/api/runs.rb +28 -0
  111. data/lib/terraspace/terraform/api/token.rb +65 -0
  112. data/lib/terraspace/terraform/api/var.rb +20 -6
  113. data/lib/terraspace/terraform/api/vars.rb +2 -1
  114. data/lib/terraspace/terraform/api/workspace.rb +98 -0
  115. data/lib/terraspace/terraform/args/default.rb +48 -21
  116. data/lib/terraspace/terraform/cloud/runs.rb +13 -0
  117. data/lib/terraspace/terraform/cloud/runs/base.rb +33 -0
  118. data/lib/terraspace/terraform/cloud/runs/item_presenter.rb +37 -0
  119. data/lib/terraspace/terraform/cloud/runs/lister.rb +20 -0
  120. data/lib/terraspace/terraform/cloud/runs/pruner.rb +109 -0
  121. data/lib/terraspace/terraform/cloud/sync.rb +41 -0
  122. data/lib/terraspace/terraform/cloud/syncer.rb +52 -0
  123. data/lib/terraspace/terraform/cloud/workspace.rb +10 -30
  124. data/lib/terraspace/terraform/hooks/builder.rb +1 -1
  125. data/lib/terraspace/terraform/remote_state/fetcher.rb +143 -0
  126. data/lib/terraspace/terraform/remote_state/marker/output.rb +39 -0
  127. data/lib/terraspace/terraform/remote_state/marker/pretty_tracer.rb +37 -0
  128. data/lib/terraspace/terraform/remote_state/output_proxy.rb +29 -0
  129. data/lib/terraspace/terraform/runner.rb +24 -14
  130. data/lib/terraspace/util.rb +1 -5
  131. data/lib/terraspace/util/pretty.rb +18 -0
  132. data/lib/terraspace/version.rb +1 -1
  133. data/spec/fixtures/fetcher/c1.json +37 -0
  134. data/spec/fixtures/parser/cache_dirs/all/01-test.auto.tfvars +5 -0
  135. data/spec/fixtures/parser/cache_dirs/depends_on/01-test.auto.tfvars +2 -0
  136. data/spec/fixtures/parser/cache_dirs/output/01-test.auto.tfvars +2 -0
  137. data/spec/fixtures/summary/down.log +12 -0
  138. data/spec/fixtures/summary/output.log +5 -0
  139. data/spec/fixtures/summary/plan/error.log +20 -0
  140. data/spec/fixtures/summary/plan/success.log +17 -0
  141. data/spec/fixtures/summary/show.log +22 -0
  142. data/spec/fixtures/summary/up/error.log +13 -0
  143. data/spec/fixtures/summary/up/success.log +63 -0
  144. data/spec/fixtures/summary/validate/error.log +13 -0
  145. data/spec/fixtures/summary/validate/success.log +5 -0
  146. data/spec/terraspace/all/grapher_spec.rb +38 -0
  147. data/spec/terraspace/all/runner_spec.rb +48 -0
  148. data/spec/terraspace/all/summary_spec.rb +93 -0
  149. data/spec/terraspace/dependency/graph_spec.rb +162 -0
  150. data/spec/terraspace/seeder_spec.rb +0 -1
  151. data/spec/terraspace/terraform/remote_state/fetcher_spec.rb +52 -0
  152. data/terraspace.gemspec +5 -1
  153. metadata +179 -6
  154. data/lib/terraspace/cli/help/update.md +0 -5
  155. data/lib/terraspace/terraform/cloud.rb +0 -25
  156. data/lib/terraspace/util/sh.rb +0 -19
@@ -0,0 +1,63 @@
1
+ class Terraspace::CLI
2
+ class All < Terraspace::Command
3
+ class_option :yes, aliases: :y, type: :boolean, desc: "auto approve all batch commands"
4
+ class_option :exit_on_fail, type: :boolean, desc: "whether or not to exit when one of the batch commands fails"
5
+
6
+ desc "down", "Destroy all or multiple stacks."
7
+ long_desc Help.text("all/down")
8
+ option :destroy_workspace, type: :boolean, desc: "Also destroy the Cloud workspace. Only applies when using Terraform Cloud remote backend."
9
+ def down(*stacks)
10
+ Terraspace::All::Runner.new("down", @options.merge(stacks: stacks)).run
11
+ end
12
+
13
+ desc "graph", "Draw a dependency graph."
14
+ long_desc Help.text("all/graph")
15
+ option :format, default: "png", desc: "format: text or diagram"
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"
17
+ def graph(*stacks)
18
+ Terraspace::All::Grapher.new(@options.merge(stacks: stacks)).run
19
+ end
20
+
21
+ desc "refresh", "Refresh all or multiple stacks."
22
+ long_desc Help.text("all/refresh")
23
+ def refresh(*stacks)
24
+ Terraspace::All::Runner.new("refresh", @options.merge(stacks: stacks)).run
25
+ end
26
+
27
+ desc "output", "Show output for all or multiple stacks."
28
+ long_desc Help.text("all/output")
29
+ def output(*stacks)
30
+ Terraspace::All::Runner.new("output", @options.merge(stacks: stacks)).run
31
+ end
32
+
33
+ desc "plan", "Run plan for all or multiple stacks."
34
+ long_desc Help.text("all/plan")
35
+ def plan(*stacks)
36
+ Terraspace::All::Runner.new("plan", @options.merge(stacks: stacks)).run
37
+ end
38
+
39
+ desc "providers", "Show providers for all or multiple stacks."
40
+ long_desc Help.text("all/providers")
41
+ def providers(*stacks)
42
+ Terraspace::All::Runner.new("providers", @options.merge(stacks: stacks)).run
43
+ end
44
+
45
+ desc "show", "Run show for all or multiple stacks."
46
+ long_desc Help.text("all/show")
47
+ def show(*stacks)
48
+ Terraspace::All::Runner.new("show", @options.merge(stacks: stacks)).run
49
+ end
50
+
51
+ desc "up", "Deploy all or multiple stacks."
52
+ long_desc Help.text("all/up")
53
+ def up(*stacks)
54
+ Terraspace::All::Runner.new("up", @options.merge(stacks: stacks)).run
55
+ end
56
+
57
+ desc "validate", "Validate all or multiple stacks."
58
+ long_desc Help.text("all/validate")
59
+ def validate(*stacks)
60
+ Terraspace::All::Runner.new("validate", @options.merge(stacks: stacks)).run
61
+ end
62
+ end
63
+ end
@@ -16,7 +16,7 @@ module Terraspace::CLI::Build
16
16
  return if ENV['TS_SUMMARY_BUILD'] == '0'
17
17
 
18
18
  mod = @options[:mod]
19
- if !mod or mod == "placeholder"
19
+ if !mod or %w[placeholder].include?(mod)
20
20
  logger.info "Building one of the modules to get backend.tf info"
21
21
  mod = find_mod
22
22
  end
@@ -28,10 +28,7 @@ module Terraspace::CLI::Build
28
28
  def find_mod
29
29
  mod_path = Dir.glob("{app,vendor}/{modules,stacks}/*").last
30
30
  unless mod_path
31
- logger.info <<~EOL
32
- No modules or stacks found.
33
- Unable to determine the backend state path without at least one module.
34
- EOL
31
+ logger.info "No modules or stacks found."
35
32
  exit 0
36
33
  end
37
34
  File.basename(mod_path) # mod name
@@ -1,5 +1,5 @@
1
1
  require "terraspace-bundler"
2
- TerraspaceBundler.logger = Terraspace.logger
2
+ TerraspaceBundler.config.logger = Terraspace.logger
3
3
 
4
4
  class Terraspace::CLI
5
5
  class Bundle
@@ -40,6 +40,10 @@ class Terraspace::CLI
40
40
 
41
41
  def ok?
42
42
  version = terraform_version_message.sub(/.*v/,'') # => 0.12.24
43
+ unless version.match(/\d+\.\d+\.\d+/) # just parse did not find the version number
44
+ puts "WARN: Unable to get the terraform version".color(:yellow)
45
+ return true
46
+ end
43
47
  major, minor, _ = version.split('.')
44
48
  required_major, required_minor = REQUIRED_TERRAFORM_VERSION.split('.')
45
49
  x = major.to_i >= required_major.to_i
@@ -62,6 +66,7 @@ class Terraspace::CLI
62
66
  # Your version of Terraform is out of date! The latest version
63
67
  # is 0.12.26. You can update by downloading from https://www.terraform.io/downloads.html
64
68
  #
69
+ # Note: The -json option is only available in v0.13+
65
70
  def terraform_version_message
66
71
  `terraform --version`.split("\n").find { |l| l =~ /^Terraform / }.strip
67
72
  end
@@ -1,24 +1,34 @@
1
1
  class Terraspace::CLI
2
2
  class Cloud < Terraspace::Command
3
+ Syncer = Terraspace::Terraform::Cloud::Syncer
3
4
  Workspace = Terraspace::Terraform::Cloud::Workspace
4
5
 
6
+ yes_option = Proc.new {
7
+ option :yes, aliases: :y, type: :boolean, desc: "bypass are you sure prompt"
8
+ }
9
+
5
10
  desc "list", "List workspaces"
6
11
  long_desc Help.text("cloud:list")
12
+ yes_option.call
7
13
  def list
8
14
  Workspace.new(options).list
9
15
  end
10
16
 
11
- desc "destroy STACK", "Destroy workspace"
17
+ desc "destroy STACK", "Destroy workspace by specifying the stack"
12
18
  long_desc Help.text("cloud:destroy")
13
- option :yes, aliases: :y, type: :boolean, desc: "bypass are you sure prompt"
14
19
  def destroy(mod)
15
20
  Workspace.new(options.merge(mod: mod)).destroy
16
21
  end
17
22
 
18
- desc "setup STACK", "Setup workspace"
19
- long_desc Help.text("cloud:setup")
20
- def setup(mod)
21
- Workspace.new(options.merge(mod: mod)).setup
23
+ desc "sync [STACK]", "Sync all or multiple workspaces."
24
+ long_desc Help.text("cloud:sync")
25
+ yes_option.call
26
+ def sync(*stacks)
27
+ Syncer.new(options.merge(stacks: stacks, override_auto_sync: true)).run
22
28
  end
29
+
30
+ desc "runs SUBCOMMAND", "runs subcommands"
31
+ long_desc Help.text(:runs)
32
+ subcommand "runs", Runs
23
33
  end
24
34
  end
@@ -0,0 +1,22 @@
1
+ class Terraspace::CLI::Cloud
2
+ class Runs < Terraspace::Command
3
+ Help = Terraspace::CLI::Help
4
+ Runs = Terraspace::Terraform::Cloud::Runs
5
+
6
+ desc "list STACK", "List runs."
7
+ long_desc Help.text("cloud:runs:list")
8
+ option :format, desc: "Output formats: #{CliFormat.formats.join(', ')}"
9
+ option :status, default: %w[pending planned], type: :array, desc: "Filter by statuses: pending, planned, all"
10
+ def list(mod)
11
+ Runs.new(options.merge(mod: mod)).list
12
+ end
13
+
14
+ desc "prune STACK", "Prune runs that are possible to cancel or discard."
15
+ long_desc Help.text("cloud:runs:prune")
16
+ option :noop, type: :boolean, desc: "Shows what would be cancelled/discarded."
17
+ option :yes, aliases: :y, type: :boolean, desc: "bypass are you sure prompt"
18
+ def prune(mod)
19
+ Runs.new(options.merge(mod: mod)).prune
20
+ end
21
+ end
22
+ end
@@ -5,17 +5,10 @@ class Terraspace::CLI
5
5
  super(options)
6
6
  end
7
7
 
8
- # Commander always runs Build#run
9
8
  def run
10
- Terraspace::Builder.new(@options).run # generate and init
11
- auto_create_backend
9
+ Terraspace::Builder.new(@options).run unless @options[:build] # Up already ran build
12
10
  Init.new(@options.merge(calling_command: @name)).run
13
11
  Terraspace::Terraform::Runner.new(@name, @options).run
14
12
  end
15
-
16
- def auto_create_backend
17
- return unless @name == "apply"
18
- Terraspace::Compiler::Backend.new(@mod).create
19
- end
20
13
  end
21
14
  end
@@ -0,0 +1,20 @@
1
+ class Terraspace::CLI
2
+ class Down < Base
3
+ include TfcConcern
4
+
5
+ def run
6
+ plan if @options[:yes] && !tfc?
7
+ destroy
8
+ end
9
+
10
+ private
11
+ def plan
12
+ Commander.new("plan", @options.merge(destroy: true)).run
13
+ end
14
+
15
+ def destroy
16
+ Commander.new("destroy", @options.merge(command: "down")).run
17
+ Terraspace::Terraform::Cloud::Workspace.new(@options).destroy if @options[:destroy_workspace]
18
+ end
19
+ end
20
+ end
@@ -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
+ $
@@ -0,0 +1,6 @@
1
+ ## Example
2
+
3
+ $ terraspace build
4
+ Building .terraspace-cache/us-west-2/dev/stacks/demo
5
+ Built in .terraspace-cache/us-west-2/dev/stacks/demo
6
+ $