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,39 @@
1
+ module Terraspace::Terraform::RemoteState::Marker
2
+ class Output
3
+ include Terraspace::Util::Logging
4
+
5
+ def initialize(mod, identifier, options={})
6
+ @mod, @identifier, @options = mod, identifier, options
7
+ @parent_name = @mod.name
8
+ @child_name, @output_key = @identifier.split('.')
9
+ end
10
+
11
+ def build
12
+ if valid?
13
+ Terraspace::Dependency::Registry.register(@parent_name, @child_name)
14
+ else
15
+ warning
16
+ end
17
+ # MARKER for debugging. Only appears on 1st pass. Will not see unless changing Terraspace code for debugging.
18
+ marker = "MARKER:terraform_output('#{@identifier}')"
19
+ Terraspace::Terraform::RemoteState::OutputProxy.new(marker, @options)
20
+ end
21
+
22
+ def valid?
23
+ self.class.stack_names.include?(@child_name)
24
+ end
25
+
26
+ def warning
27
+ logger.warn "WARN: The #{@child_name} stack does not exist".color(:yellow)
28
+ caller_line = caller.find { |l| l.include?('.tfvars') }
29
+ source_code = PrettyTracer.new(caller_line).source_code
30
+ logger.info source_code
31
+ end
32
+
33
+ class << self
34
+ extend Memoist
35
+ # Marker::Output uses DirsConcern stack_names to check if stacks are valid
36
+ include Terraspace::Compiler::DirsConcern
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,37 @@
1
+ module Terraspace::Terraform::RemoteState::Marker
2
+ class PrettyTracer
3
+ def initialize(caller_line)
4
+ @caller_line = caller_line
5
+ end
6
+
7
+ # /full/path/to/app/stacks/a1/tfvars/dev.tfvars:4:in `__tilt_5560'
8
+ def source_code
9
+ line = @caller_line.sub(/:in `.*/,'')
10
+ path, error_line_number = line.split(':')
11
+ pretty_trace(path, error_line_number.to_i)
12
+ end
13
+
14
+ def pretty_trace(path, error_line_number)
15
+ io = StringIO.new
16
+ context = 5 # lines of context
17
+ top, bottom = [error_line_number-context-1, 0].max, error_line_number+context-1
18
+
19
+ io.puts "Here's the line in #{Terraspace::Util.pretty_path(path)} with the error:\n\n"
20
+
21
+ lines = IO.read(path).split("\n")
22
+ context = 5 # lines of context
23
+ top, bottom = [error_line_number-context-1, 0].max, error_line_number+context-1
24
+ spacing = lines.size.to_s.size
25
+ lines[top..bottom].each_with_index do |line_content, index|
26
+ line_number = top+index+1
27
+ if line_number == error_line_number
28
+ io.printf("%#{spacing}d %s\n".color(:red), line_number, line_content)
29
+ else
30
+ io.printf("%#{spacing}d %s\n", line_number, line_content)
31
+ end
32
+ end
33
+
34
+ io.string
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+ module Terraspace::Terraform::RemoteState
2
+ class OutputProxy
3
+ # raw: can be anything: String, Array, Hash, etc
4
+ # options: original options passed by user with terraform_output
5
+ attr_reader :raw, :options
6
+ def initialize(raw, options={})
7
+ @raw, @options = raw, options
8
+ @format = @options[:format]
9
+ end
10
+
11
+ # Should always return a String
12
+ def to_s
13
+ case @format
14
+ when "string"
15
+ content.to_s
16
+ else # "json"
17
+ content.to_json
18
+ end
19
+ end
20
+
21
+ def content
22
+ if @raw.nil?
23
+ @options[:mock] || @options[:error]
24
+ else
25
+ @raw
26
+ end
27
+ end
28
+ end
29
+ end
@@ -7,6 +7,7 @@ module Terraspace::Terraform
7
7
  def initialize(name, options={})
8
8
  @name = name
9
9
  super(options)
10
+ @retries = 1
10
11
  end
11
12
 
12
13
  def run
@@ -21,17 +22,37 @@ module Terraspace::Terraform
21
22
  params = args.flatten.join(' ')
22
23
  command = "terraform #{name} #{params}"
23
24
  run_hooks(name) do
24
- sh(command, env: custom.env_vars)
25
+ Terraspace::Shell.new(@mod, command, @options.merge(env: custom.env_vars)).run
26
+ end
27
+ rescue Terraspace::InitRequiredError => e
28
+ logger.info "Terraform reinitialization required detected. Will run `terraform init` and try again."
29
+ logger.debug "Retry attempt: #{@retries}"
30
+ logger.debug "#{e.class}"
31
+ Runner.new("init", @options).run
32
+ if @retries <= 3
33
+ backoff = 2 ** @retries # 2, 4, 8
34
+ logger.debug "Waiting #{backoff}s before retrying"
35
+ sleep(backoff)
36
+ @retries += 1
37
+ retry
38
+ else
39
+ logger.info "ERROR: #{e.message}"
40
+ exit 1
25
41
  end
26
42
  end
27
43
 
28
44
  @@current_dir_message_shown = false
29
45
  def current_dir_message
30
46
  return if @@current_dir_message_shown
31
- logger.info "Current directory: #{Terraspace::Util.pretty_path(@mod.cache_dir)}"
47
+ log "Current directory: #{Terraspace::Util.pretty_path(@mod.cache_dir)}"
32
48
  @@current_dir_message_shown = true
33
49
  end
34
50
 
51
+ def log(msg)
52
+ # quiet useful for RemoteState::Fetcher
53
+ @options[:quiet] ? logger.debug(msg) : logger.info(msg)
54
+ end
55
+
35
56
  def run_hooks(name, &block)
36
57
  hooks = Hooks::Builder.new(@mod, name)
37
58
  hooks.build # build hooks
@@ -59,18 +80,7 @@ module Terraspace::Terraform
59
80
  yield
60
81
  t2 = Time.now
61
82
  if %w[apply destroy].include?(@name)
62
- puts "Time took: #{pretty_time(t2-t1)}"
63
- end
64
- end
65
-
66
- # http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby
67
- def pretty_time(total_seconds)
68
- minutes = (total_seconds / 60) % 60
69
- seconds = total_seconds % 60
70
- if total_seconds < 60
71
- "#{seconds.to_i}s"
72
- else
73
- "#{minutes.to_i}m #{seconds.to_i}s"
83
+ logger.info "Time took: #{pretty_time(t2-t1)}"
74
84
  end
75
85
  end
76
86
  end
@@ -1,12 +1,8 @@
1
1
  module Terraspace
2
2
  module Util
3
3
  include Logging
4
- include Sh
5
4
  include Sure
6
-
7
- def pretty_path(path)
8
- ENV['TS_TEST'] ? path : path.sub("#{Terraspace.root}/",'')
9
- end
5
+ include Pretty
10
6
 
11
7
  extend self
12
8
  end
@@ -0,0 +1,18 @@
1
+ module Terraspace::Util
2
+ module Pretty
3
+ # http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby
4
+ def pretty_time(total_seconds)
5
+ minutes = (total_seconds / 60) % 60
6
+ seconds = total_seconds % 60
7
+ if total_seconds < 60
8
+ "#{seconds.to_i}s"
9
+ else
10
+ "#{minutes.to_i}m #{seconds.to_i}s"
11
+ end
12
+ end
13
+
14
+ def pretty_path(path)
15
+ ENV['TS_TEST'] ? path : path.sub("#{Terraspace.root}/",'')
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "0.2.4"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -0,0 +1,37 @@
1
+ {
2
+ "version": 4,
3
+ "terraform_version": "0.13.1",
4
+ "serial": 30,
5
+ "lineage": "9b6b98f3-3bc7-362d-5232-71847ce6d86a",
6
+ "outputs": {
7
+ "length": {
8
+ "value": 1,
9
+ "type": "number"
10
+ },
11
+ "random_pet_id": {
12
+ "value": "valued-buzzard",
13
+ "type": "string"
14
+ }
15
+ },
16
+ "resources": [
17
+ {
18
+ "mode": "managed",
19
+ "type": "random_pet",
20
+ "name": "this",
21
+ "provider": "provider[\"registry.terraform.io/hashicorp/random\"]",
22
+ "instances": [
23
+ {
24
+ "schema_version": 0,
25
+ "attributes": {
26
+ "id": "valued-buzzard",
27
+ "keepers": null,
28
+ "length": 2,
29
+ "prefix": null,
30
+ "separator": "-"
31
+ },
32
+ "private": "bnVsbA=="
33
+ }
34
+ ]
35
+ }
36
+ ]
37
+ }
@@ -0,0 +1,5 @@
1
+
2
+ # MARKER_DEPENDS_ON:b1:c1 #
3
+
4
+ length1 = MARKER_OUTPUT:b1:c1.length #
5
+ length1 = MARKER_OUTPUT:b1:c2.length #
@@ -0,0 +1,2 @@
1
+
2
+ # MARKER_DEPENDS_ON:b1:c1 #
@@ -0,0 +1,2 @@
1
+
2
+ length1 = MARKER_OUTPUT:b1:c1.length #
@@ -0,0 +1,12 @@
1
+ # Logfile created on 2020-09-09 12:43:23 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T12:43:23 #18949 terraspace down a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T12:43:23 #18949 terraspace down a1]: => terraform destroy -auto-approve
4
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: random_pet.pet1: Refreshing state... [id=python]
5
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: random_pet.pet2: Refreshing state... [id=hound]
6
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: random_pet.pet2: Destroying... [id=hound]
7
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: random_pet.pet1: Destroying... [id=python]
8
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: random_pet.pet2: Destruction complete after 0s
9
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: random_pet.pet1: Destruction complete after 0s
10
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: 
11
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: Destroy complete! Resources: 2 destroyed.
12
+ [2020-09-09T12:43:24 #18949 terraspace down a1]: Time took: 1s
@@ -0,0 +1,5 @@
1
+ # Logfile created on 2020-09-09 13:30:18 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T13:30:18 #20693 terraspace output a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T13:30:18 #20693 terraspace output a1]: => terraform output
4
+ [2020-09-09T13:30:19 #20693 terraspace output a1]: pet1 = krill
5
+ [2020-09-09T13:30:19 #20693 terraspace output a1]: pet2 = sunfish
@@ -0,0 +1,20 @@
1
+ # Logfile created on 2020-09-09 12:49:43 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T12:49:43 #9022 terraspace plan a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T12:49:43 #9022 terraspace plan a1]: => terraform plan
4
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 
5
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: Error: Unbalanced parentheses
6
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]:
7
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]:  on 01-dev.auto.tfvars line 4:
8
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 4: length1 = (Output length was not found for the a1 tfvars file. Either b1 stack has not been deployed yet or it has no outputs)
9
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 
10
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: Expected a closing parenthesis to terminate the expression.
11
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 
12
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 
13
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: Error: Unbalanced parentheses
14
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]:
15
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]:  on 01-dev.auto.tfvars line 5:
16
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 5: length2 = (Output length was not found for the a1 tfvars file. Either b2 stack has not been deployed yet or it has no outputs)
17
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 
18
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: Expected a closing parenthesis to terminate the expression.
19
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: 
20
+ [2020-09-09T12:49:44 #9022 terraspace plan a1]: Error running command: terraform plan 
@@ -0,0 +1,17 @@
1
+ # Logfile created on 2020-09-09 12:55:02 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T12:55:02 #6599 terraspace plan a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T12:55:02 #6599 terraspace plan a1]: => terraform plan
4
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: Refreshing Terraform state in-memory prior to plan...
5
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: The refreshed state will be used to calculate this plan, but will not be
6
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: persisted to local or remote state storage.
7
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: 
8
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: random_pet.pet1: Refreshing state... [id=krill]
9
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: random_pet.pet2: Refreshing state... [id=sunfish]
10
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]:
11
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: ------------------------------------------------------------------------
12
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]:
13
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: No changes. Infrastructure is up-to-date.
14
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]:
15
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: This means that Terraform did not detect any differences between your
16
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: configuration and real physical resources that exist. As a result, no
17
+ [2020-09-09T12:55:03 #6599 terraspace plan a1]: actions need to be performed.
@@ -0,0 +1,22 @@
1
+ # Logfile created on 2020-09-09 13:31:26 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: => terraform show
4
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: # random_pet.pet1:
5
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: resource "random_pet" "pet1" {
6
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: id = "krill"
7
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: length = 1
8
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: separator = "-"
9
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: }
10
+ [2020-09-09T13:31:26 #32045 terraspace show a1]:
11
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: # random_pet.pet2:
12
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: resource "random_pet" "pet2" {
13
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: id = "sunfish"
14
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: length = 1
15
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: separator = "-"
16
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: }
17
+ [2020-09-09T13:31:26 #32045 terraspace show a1]:
18
+ [2020-09-09T13:31:26 #32045 terraspace show a1]:
19
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: Outputs:
20
+ [2020-09-09T13:31:26 #32045 terraspace show a1]:
21
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: pet1 = "krill"
22
+ [2020-09-09T13:31:26 #32045 terraspace show a1]: pet2 = "sunfish"
@@ -0,0 +1,13 @@
1
+ # Logfile created on 2020-09-09 13:36:29 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: => terraform plan -out /tmp/terraspace/plans/a1-20200909133629.plan
4
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: 
5
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: Error: Unsupported attribute
6
+ [2020-09-09T13:36:29 #15895 terraspace up a1]:
7
+ [2020-09-09T13:36:29 #15895 terraspace up a1]:  on outputs.tf line 8, in output "pet2":
8
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: 8: value = random_pet.pet2.id2
9
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: 
10
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: This object has no argument, nested block, or exported attribute named "id2".
11
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: Did you mean "id"?
12
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: 
13
+ [2020-09-09T13:36:29 #15895 terraspace up a1]: Error running command: terraform plan -out /tmp/terraspace/plans/a1-20200909133629.plan
@@ -0,0 +1,63 @@
1
+ # Logfile created on 2020-09-09 12:43:06 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T12:43:06 #14973 terraspace up a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T12:43:06 #14973 terraspace up a1]: => terraform plan -out /tmp/terraspace/plans/a1-20200909124306.plan
4
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: Refreshing Terraform state in-memory prior to plan...
5
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: The refreshed state will be used to calculate this plan, but will not be
6
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: persisted to local or remote state storage.
7
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: 
8
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
9
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: ------------------------------------------------------------------------
10
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
11
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: An execution plan has been generated and is shown below.
12
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: Resource actions are indicated with the following symbols:
13
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + create
14
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: 
15
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: Terraform will perform the following actions:
16
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
17
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:  # random_pet.pet1 will be created
18
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:  + resource "random_pet" "pet1" {
19
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + id = (known after apply)
20
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + length = 1
21
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + separator = "-"
22
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: }
23
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
24
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:  # random_pet.pet2 will be created
25
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:  + resource "random_pet" "pet2" {
26
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + id = (known after apply)
27
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + length = 1
28
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + separator = "-"
29
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: }
30
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
31
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: Plan: 2 to add, 0 to change, 0 to destroy.
32
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: 
33
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: Changes to Outputs:
34
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + pet1 = (known after apply)
35
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: + pet2 = (known after apply)
36
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
37
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: ------------------------------------------------------------------------
38
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
39
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: This plan was saved to: /tmp/terraspace/plans/a1-20200909124306.plan
40
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
41
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: To perform exactly these actions, run the following command to apply:
42
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: terraform apply "/tmp/terraspace/plans/a1-20200909124306.plan"
43
+ [2020-09-09T12:43:07 #14973 terraspace up a1]:
44
+ [2020-09-09T12:43:07 #14973 terraspace up a1]: => terraform apply -auto-approve /tmp/terraspace/plans/a1-20200909124306.plan
45
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: random_pet.pet2: Creating...
46
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: random_pet.pet1: Creating...
47
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: random_pet.pet2: Creation complete after 0s [id=hound]
48
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: random_pet.pet1: Creation complete after 0s [id=python]
49
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: 
50
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
51
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: 
52
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: The state of your infrastructure has been saved to the path
53
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: below. This state is required to modify and destroy your
54
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: infrastructure, so keep it safe. To inspect the complete state
55
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: use the `terraform show` command.
56
+ [2020-09-09T12:43:08 #14973 terraspace up a1]:
57
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: State path: terraform.tfstate
58
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: 
59
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: Outputs:
60
+ [2020-09-09T12:43:08 #14973 terraspace up a1]:
61
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: pet1 = python
62
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: pet2 = hound
63
+ [2020-09-09T12:43:08 #14973 terraspace up a1]: Time took: 0s
@@ -0,0 +1,13 @@
1
+ # Logfile created on 2020-09-09 13:34:25 +0000 by logger.rb/v1.4.2
2
+ [2020-09-09T13:34:25 #22695 terraspace validate a1]: Current directory: .terraspace-cache/us-west-2/dev/stacks/a1
3
+ [2020-09-09T13:34:25 #22695 terraspace validate a1]: => terraform validate
4
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: 
5
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: Error: Unsupported attribute
6
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]:
7
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]:  on outputs.tf line 8, in output "pet2":
8
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: 8: value = random_pet.pet2.id2
9
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: 
10
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: This object has no argument, nested block, or exported attribute named "id2".
11
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: Did you mean "id"?
12
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: 
13
+ [2020-09-09T13:34:26 #22695 terraspace validate a1]: Error running command: terraform validate