terraspace 1.1.7 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/all/{role.rb → iam_role.rb} +0 -0
  3. data/.cody/all/project.rb +6 -2
  4. data/.cody/aws/bin/build.sh +5 -0
  5. data/.cody/aws/{role.rb → iam_role.rb} +0 -0
  6. data/.cody/aws/project.rb +6 -2
  7. data/.cody/azurerm/bin/build.sh +5 -0
  8. data/.cody/azurerm/{role.rb → iam_role.rb} +0 -0
  9. data/.cody/azurerm/project.rb +5 -3
  10. data/.cody/google/bin/build.sh +5 -0
  11. data/.cody/google/{role.rb → iam_role.rb} +0 -0
  12. data/.cody/google/project.rb +5 -3
  13. data/.cody/none/bin/build.sh +5 -0
  14. data/.cody/none/{role.rb → iam_role.rb} +0 -0
  15. data/.cody/none/project.rb +6 -2
  16. data/.cody/shared/script/install/terraform.sh +2 -1
  17. data/.cody/shared/script/update/gemfile.sh +2 -0
  18. data/.cody/unit/project.rb +2 -2
  19. data/.gitignore +2 -0
  20. data/.pipedream/pipeline.rb +3 -3
  21. data/CHANGELOG.md +29 -0
  22. data/exe/terraspace +0 -7
  23. data/lib/templates/base/project/config/app.rb +3 -0
  24. data/lib/templates/plugin/ci/%gem_name%.gemspec.tt +32 -0
  25. data/lib/templates/plugin/ci/.gitignore +12 -0
  26. data/lib/templates/plugin/{.rspec → ci/.rspec} +0 -0
  27. data/lib/templates/plugin/ci/.rubocop.yml +13 -0
  28. data/lib/templates/plugin/ci/CHANGELOG.md.tt +5 -0
  29. data/lib/templates/plugin/ci/Gemfile +10 -0
  30. data/lib/templates/plugin/ci/LICENSE.txt +21 -0
  31. data/lib/templates/plugin/ci/README.md.tt +19 -0
  32. data/lib/templates/plugin/ci/Rakefile +12 -0
  33. data/lib/templates/plugin/ci/lib/%gem_name%/autoloader.rb.tt +23 -0
  34. data/lib/templates/plugin/ci/lib/%gem_name%/interface.rb.tt +15 -0
  35. data/lib/templates/plugin/ci/lib/%gem_name%/pr.rb.tt +15 -0
  36. data/lib/templates/plugin/ci/lib/%gem_name%/vars.rb.tt +26 -0
  37. data/lib/templates/plugin/ci/lib/%gem_name%/version.rb.tt +5 -0
  38. data/lib/templates/plugin/ci/lib/%gem_name%.rb.tt +17 -0
  39. data/lib/templates/plugin/ci/spec/%gem_name%_spec.rb.tt +7 -0
  40. data/lib/templates/plugin/ci/spec/spec_helper.rb.tt +15 -0
  41. data/lib/templates/plugin/{.gitignore → core/.gitignore} +0 -0
  42. data/lib/templates/plugin/core/.rspec +3 -0
  43. data/lib/templates/plugin/{CHANGELOG.md → core/CHANGELOG.md} +0 -0
  44. data/lib/templates/plugin/{Gemfile → core/Gemfile} +0 -0
  45. data/lib/templates/plugin/{LICENSE.txt → core/LICENSE.txt} +0 -0
  46. data/lib/templates/plugin/{README.md.tt → core/README.md.tt} +0 -0
  47. data/lib/templates/plugin/{Rakefile → core/Rakefile} +0 -0
  48. data/lib/templates/plugin/{bin → core/bin}/console.tt +0 -0
  49. data/lib/templates/plugin/{bin → core/bin}/setup +0 -0
  50. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/main.tf +0 -0
  51. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/outputs.tf +0 -0
  52. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/module/variables.tf +0 -0
  53. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/backend.tf.tt +0 -0
  54. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/project/config/terraform/provider.tf +0 -0
  55. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/main.tf +0 -0
  56. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/outputs.tf +0 -0
  57. data/lib/templates/plugin/{lib → core/lib}/templates/hcl/stack/variables.tf +0 -0
  58. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/main.rb +0 -0
  59. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/outputs.rb +0 -0
  60. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/module/variables.rb +0 -0
  61. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/backend.rb.tt +0 -0
  62. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/project/config/terraform/provider.rb +0 -0
  63. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/main.rb +0 -0
  64. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/outputs.rb +0 -0
  65. data/lib/templates/plugin/{lib → core/lib}/templates/ruby/stack/variables.rb +0 -0
  66. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/.rspec +0 -0
  67. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/Gemfile +0 -0
  68. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/main.tf +0 -0
  69. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf +0 -0
  70. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf +0 -0
  71. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/main_spec.rb +0 -0
  72. data/lib/templates/plugin/{lib → core/lib}/templates/test/rspec/module/test/spec/spec_helper.rb +0 -0
  73. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/autoloader.rb.tt +0 -0
  74. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/clients.rb.tt +0 -0
  75. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/backend.rb.tt +0 -0
  76. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/config.rb.tt +0 -0
  77. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/expander.rb.tt +0 -0
  78. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/interfaces/layer.rb.tt +0 -0
  79. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%/version.rb.tt +0 -0
  80. data/lib/templates/plugin/{lib → core/lib}/terraspace_plugin_%name%.rb.tt +0 -0
  81. data/lib/templates/plugin/{spec → core/spec}/spec_helper.rb.tt +0 -0
  82. data/lib/templates/plugin/{spec → core/spec}/terraspace_provider_%name%_spec.rb.tt +0 -0
  83. data/lib/templates/plugin/{terraspace_plugin_%name%.gemspec.tt → core/terraspace_plugin_%name%.gemspec.tt} +0 -0
  84. data/lib/terraspace/all/runner.rb +2 -0
  85. data/lib/terraspace/all/summary.rb +2 -0
  86. data/lib/terraspace/app.rb +23 -4
  87. data/lib/terraspace/builder.rb +1 -1
  88. data/lib/terraspace/cli/concerns/plan_path.rb +8 -0
  89. data/lib/terraspace/cli/down.rb +4 -0
  90. data/lib/terraspace/cli/init.rb +1 -1
  91. data/lib/terraspace/cli/new/ci.rb +121 -0
  92. data/lib/terraspace/cli/new/example.rb +1 -1
  93. data/lib/terraspace/cli/new/helpers/plugin_gem.rb +1 -1
  94. data/lib/terraspace/cli/new/plugin/ci.rb +46 -0
  95. data/lib/terraspace/cli/new/plugin/core.rb +26 -0
  96. data/lib/terraspace/cli/new/plugin/helper.rb +4 -1
  97. data/lib/terraspace/cli/new/plugin.rb +8 -15
  98. data/lib/terraspace/cli/new/test.rb +1 -1
  99. data/lib/terraspace/cli/new.rb +17 -13
  100. data/lib/terraspace/cli/plan.rb +13 -0
  101. data/lib/terraspace/cli/setup/check.rb +8 -0
  102. data/lib/terraspace/cli/up.rb +8 -12
  103. data/lib/terraspace/cli.rb +2 -2
  104. data/lib/terraspace/cloud/api/cani.rb +30 -0
  105. data/lib/terraspace/cloud/api/concern/errors.rb +12 -0
  106. data/lib/terraspace/cloud/api/concern/record.rb +18 -0
  107. data/lib/terraspace/cloud/api/concern.rb +38 -0
  108. data/lib/terraspace/cloud/api/http_methods.rb +116 -0
  109. data/lib/terraspace/cloud/api/validate.rb +24 -0
  110. data/lib/terraspace/cloud/api.rb +33 -0
  111. data/lib/terraspace/cloud/base.rb +97 -0
  112. data/lib/terraspace/cloud/ci/generic.rb +25 -0
  113. data/lib/terraspace/cloud/ci/manual.rb +81 -0
  114. data/lib/terraspace/cloud/ci/vcs/base.rb +36 -0
  115. data/lib/terraspace/cloud/ci/vcs/bitbucket.rb +11 -0
  116. data/lib/terraspace/cloud/ci/vcs/github.rb +11 -0
  117. data/lib/terraspace/cloud/ci/vcs/gitlab.rb +11 -0
  118. data/lib/terraspace/cloud/ci/vcs.rb +18 -0
  119. data/lib/terraspace/cloud/ci.rb +56 -0
  120. data/lib/terraspace/cloud/context.rb +14 -0
  121. data/lib/terraspace/cloud/folder/base.rb +17 -0
  122. data/lib/terraspace/cloud/folder/package.rb +33 -0
  123. data/lib/terraspace/cloud/folder/tidy.rb +54 -0
  124. data/lib/terraspace/cloud/folder/uploader.rb +37 -0
  125. data/lib/terraspace/cloud/folder.rb +11 -0
  126. data/lib/terraspace/cloud/plan.rb +47 -0
  127. data/lib/terraspace/cloud/update.rb +37 -0
  128. data/lib/terraspace/command.rb +16 -1
  129. data/lib/terraspace/compiler/dsl/syntax/mod.rb +2 -2
  130. data/lib/terraspace/compiler/dsl/syntax/tfvar.rb +1 -1
  131. data/lib/terraspace/compiler/expander/backend.rb +1 -1
  132. data/lib/terraspace/compiler/expander.rb +1 -1
  133. data/lib/terraspace/compiler/strategy/tfvar/layer.rb +56 -29
  134. data/lib/terraspace/core.rb +44 -3
  135. data/lib/terraspace/ext/core/module.rb +9 -4
  136. data/lib/terraspace/hooks/builder.rb +1 -1
  137. data/lib/terraspace/logger.rb +32 -5
  138. data/lib/terraspace/mod.rb +21 -9
  139. data/lib/terraspace/plugin/expander/interface.rb +16 -11
  140. data/lib/terraspace/plugin.rb +14 -5
  141. data/lib/terraspace/shell.rb +7 -2
  142. data/lib/terraspace/terraform/args/thor.rb +8 -2
  143. data/lib/terraspace/terraform/ihooks/after/apply.rb +8 -0
  144. data/lib/terraspace/terraform/ihooks/after/destroy.rb +8 -0
  145. data/lib/terraspace/terraform/ihooks/after/plan.rb +31 -2
  146. data/lib/terraspace/terraform/ihooks/base.rb +7 -3
  147. data/lib/terraspace/terraform/ihooks/before/apply.rb +8 -0
  148. data/lib/terraspace/terraform/ihooks/before/destroy.rb +8 -0
  149. data/lib/terraspace/terraform/ihooks/before/plan.rb +11 -3
  150. data/lib/terraspace/terraform/runner.rb +19 -5
  151. data/lib/terraspace/version.rb +1 -1
  152. data/lib/terraspace.rb +2 -0
  153. data/terraspace.gemspec +1 -0
  154. metadata +116 -52
  155. data/.pipedream/schedule.rb +0 -3
@@ -34,6 +34,11 @@ module Terraspace
34
34
 
35
35
  def popen3(env)
36
36
  Open3.popen3(env, @command, chdir: @mod.cache_dir) do |stdin, stdout, stderr, wait_thread|
37
+ # interesting. simply handling the trap and doing nothing works
38
+ # Think its because ctrl-c is sent to both processes.
39
+ # 1. we do nothing in here in the parent process
40
+ # 2. in the child process the ctrl-c gets sent directly to the terraform command
41
+ Signal.trap("INT") { }
37
42
  handle_streams(stdin, stdout, stderr)
38
43
  status = wait_thread.value.exitstatus
39
44
  exit_status(status)
@@ -112,6 +117,7 @@ module Terraspace
112
117
  end
113
118
  if matched
114
119
  answer = $stdin.gets
120
+ logger.stdin_capture(answer.strip)
115
121
  stdin.write_nonblock(answer)
116
122
  end
117
123
  end
@@ -139,8 +145,7 @@ module Terraspace
139
145
  if @error && @error.known?
140
146
  raise @error.instance
141
147
  elsif exit_on_fail
142
- logger.error "Error running command: #{@command}".color(:red)
143
- exit status
148
+ raise ShellError.new("Error running command: #{@command}")
144
149
  end
145
150
  end
146
151
  end
@@ -83,7 +83,7 @@ module Terraspace::Terraform::Args
83
83
 
84
84
  def output_args
85
85
  args = []
86
- args << "> #{expand.out}" if expand.out
86
+ args << "> #{out_option}" if out_option
87
87
  args
88
88
  end
89
89
 
@@ -91,12 +91,18 @@ module Terraspace::Terraform::Args
91
91
  args = []
92
92
  args << input_option
93
93
  args << "-destroy" if @options[:destroy]
94
- args << "-out #{expand.out}" if expand.out
94
+ args << "-out #{out_option}" if out_option
95
95
  # Note: based on the expand.out will run an internal hook to copy plan
96
96
  # file back up to the root project folder for use. Think this is convenient and expected behavior.
97
97
  args
98
98
  end
99
99
 
100
+ def out_option
101
+ out = expand.out
102
+ FileUtils.mkdir_p(File.dirname("#{@mod.cache_dir}/#{out}"))
103
+ out
104
+ end
105
+
100
106
  def show_args
101
107
  args = []
102
108
  plan = expand.plan
@@ -0,0 +1,8 @@
1
+ module Terraspace::Terraform::Ihooks::After
2
+ class Apply < Terraspace::Terraform::Ihooks::Base
3
+ def run
4
+ return unless Terraspace.cloud?
5
+ Terraspace::Cloud::Update.new(@options.merge(stack: @mod.name, kind: "apply")).run
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Terraspace::Terraform::Ihooks::After
2
+ class Destroy < Terraspace::Terraform::Ihooks::Base
3
+ def run
4
+ return unless Terraspace.cloud?
5
+ Terraspace::Cloud::Update.new(@options.merge(stack: @mod.name, kind: "destroy")).run
6
+ end
7
+ end
8
+ end
@@ -1,8 +1,11 @@
1
1
  module Terraspace::Terraform::Ihooks::After
2
2
  class Plan < Terraspace::Terraform::Ihooks::Base
3
+ include Terraspace::CLI::Concerns::PlanPath
4
+
3
5
  def run
4
- return if !out_option || @options[:copy_to_root] == false
5
- copy_to_root(out_option)
6
+ return if !@mod.out_option || @options[:copy_to_root] == false
7
+ @success = copy_to_root(@mod.out_option)
8
+ cloud_create_plan
6
9
  end
7
10
 
8
11
  def copy_to_root(file)
@@ -10,8 +13,34 @@ module Terraspace::Terraform::Ihooks::After
10
13
  name = file.sub("#{Terraspace.root}/",'')
11
14
  src = "#{@mod.cache_dir}/#{name}"
12
15
  dest = name
16
+ return false unless File.exist?(src) # plan wont exists if the plan errors
13
17
  FileUtils.mkdir_p(File.dirname(dest))
14
18
  FileUtils.cp(src, dest)
19
+ !!dest
20
+ end
21
+
22
+ def cloud_create_plan
23
+ return unless Terraspace.cloud?
24
+
25
+ unless @mod.out_option.include?("_cache2")
26
+ # copy absolute path directly
27
+ src = @mod.out_option.starts_with?('/') ? @mod.out_option : "#{@mod.cache_dir}/#{@mod.out_option}"
28
+ dest = "#{@mod.cache_dir}/#{plan_path}"
29
+ FileUtils.mkdir_p(File.dirname(dest))
30
+ FileUtils.cp(src, dest)
31
+ end
32
+
33
+ # for both:
34
+ # terraspace plan demo --destroy
35
+ # terraspace down demo
36
+ kind = destroy? ? "destroy" : "apply"
37
+ if Terraspace.command?("plan")
38
+ Terraspace::Cloud::Plan.new(@options.merge(stack: @mod.name, kind: kind)).run
39
+ end
40
+ # create update if not plan and plan failed
41
+ if !Terraspace.command?("plan") && !@success
42
+ Terraspace::Cloud::Update.new(@options.merge(stack: @mod.name, kind: kind)).run
43
+ end
15
44
  end
16
45
  end
17
46
  end
@@ -1,13 +1,17 @@
1
1
  module Terraspace::Terraform::Ihooks
2
2
  class Base < Terraspace::CLI::Base
3
+ include Terraspace::Cloud::Api::Concern
4
+
3
5
  def initialize(name, options={})
4
6
  @name = name
7
+ @success = options[:success]
5
8
  super(options)
6
9
  end
7
10
 
8
- def out_option
9
- expand = Terraspace::Terraform::Args::Expand.new(@mod, @options)
10
- expand.out
11
+ def destroy?
12
+ return false if @options.nil?
13
+ result = @options[:args]&.include?('--destroy') || @options[:destroy]
14
+ !!result
11
15
  end
12
16
  end
13
17
  end
@@ -0,0 +1,8 @@
1
+ module Terraspace::Terraform::Ihooks::Before
2
+ class Apply < Terraspace::Terraform::Ihooks::Base
3
+ def run
4
+ return unless Terraspace.cloud?
5
+ Terraspace::Cloud::Update.new(@options.merge(stack: @mod.name, kind: "apply")).cani?
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Terraspace::Terraform::Ihooks::Before
2
+ class Destroy < Terraspace::Terraform::Ihooks::Base
3
+ def run
4
+ return unless Terraspace.cloud?
5
+ Terraspace::Cloud::Update.new(@options.merge(stack: @mod.name, kind: "destroy")).cani?
6
+ end
7
+ end
8
+ end
@@ -1,12 +1,20 @@
1
1
  module Terraspace::Terraform::Ihooks::Before
2
2
  class Plan < Terraspace::Terraform::Ihooks::Base
3
3
  def run
4
- return unless out_option
5
- return if out_option =~ %r{^/} # not need to create parent dir for copy with absolute path
4
+ cani?
6
5
 
7
- name = out_option.sub("#{Terraspace.root}/",'')
6
+ return unless @mod.out_option
7
+ return if @mod.out_option =~ %r{^/} # not need to create parent dir for copy with absolute path
8
+
9
+ name = @mod.out_option.sub("#{Terraspace.root}/",'')
8
10
  dest = "#{@mod.cache_dir}/#{name}"
9
11
  FileUtils.mkdir_p(File.dirname(dest))
10
12
  end
13
+
14
+ def cani?
15
+ return unless Terraspace.cloud?
16
+ kind = destroy? ? "destroy" : "apply"
17
+ Terraspace::Cloud::Plan.new(@options.merge(stack: @mod.name, kind: kind)).cani?
18
+ end
11
19
  end
12
20
  end
@@ -14,6 +14,12 @@ module Terraspace::Terraform
14
14
  time_took do
15
15
  terraform(name, args)
16
16
  end
17
+
18
+ run_internal_hook(:after, name) # always run so plan and apply get saved to tsc
19
+ if @shell_error
20
+ logger.error @shell_error.message.color(:red)
21
+ exit 1 if name == "plan" && Terraspace.command?("up")
22
+ end
17
23
  end
18
24
 
19
25
  # default at end in case of redirection. IE: terraform output > /path
@@ -45,11 +51,17 @@ module Terraspace::Terraform
45
51
 
46
52
  params = args.flatten.join(' ')
47
53
  command = "terraform #{name} #{params}".squish
54
+ @shell_error = nil
48
55
  run_hooks("terraform.rb", name) do
49
56
  Backend.new(@mod).create
50
57
  run_internal_hook(:before, name)
51
- Terraspace::Shell.new(@mod, command, @options.merge(env: custom.env_vars)).run
52
- run_internal_hook(:after, name)
58
+ begin
59
+ Terraspace::Shell.new(@mod, command, @options.merge(env: custom.env_vars)).run
60
+ @success = true
61
+ rescue Terraspace::ShellError => exception
62
+ @shell_error = exception
63
+ @success = false
64
+ end
53
65
  end
54
66
  rescue Terraspace::SharedCacheError, Terraspace::InitRequiredError
55
67
  @retryer ||= Retryer.new(@mod, @options, name, $!)
@@ -63,11 +75,13 @@ module Terraspace::Terraform
63
75
 
64
76
  def run_internal_hook(type, name)
65
77
  begin
66
- klass = "Terraspace::Terraform::Ihooks::#{type.to_s.classify}::#{name.classify}".constantize
67
- rescue NameError
78
+ class_name = "Terraspace::Terraform::Ihooks::#{type.to_s.classify}::#{name.classify}"
79
+ klass = class_name.constantize
80
+ rescue NameError => e
81
+ logger.debug "DEBUG: #{e.class} #{e.message}".color(:red)
68
82
  return
69
83
  end
70
- ihook = klass.new(name, @options)
84
+ ihook = klass.new(name, @options.merge(success: @success))
71
85
  ihook.run
72
86
  end
73
87
 
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "1.1.7"
2
+ VERSION = "2.0.2"
3
3
  end
data/lib/terraspace.rb CHANGED
@@ -33,6 +33,8 @@ module Terraspace
33
33
  class BucketNotFoundError < Error; end
34
34
  class InitRequiredError < Error; end
35
35
  class SharedCacheError < Error; end
36
+ class ShellError < Error; end
37
+ class NetworkError < Error; end
36
38
  end
37
39
 
38
40
  Terraspace::Booter.boot
data/terraspace.gemspec CHANGED
@@ -39,6 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.add_dependency "thor"
40
40
  spec.add_dependency "tty-tree"
41
41
  spec.add_dependency "zeitwerk"
42
+ spec.add_dependency "zip_folder"
42
43
 
43
44
  # core baseline plugins
44
45
  spec.add_dependency "rspec-terraspace", ">= 0.3.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2022-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -248,6 +248,20 @@ dependencies:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: zip_folder
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: rspec-terraspace
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -343,33 +357,34 @@ files:
343
357
  - ".cody/README.md"
344
358
  - ".cody/all/bin/build.sh"
345
359
  - ".cody/all/buildspec.yml"
360
+ - ".cody/all/iam_role.rb"
346
361
  - ".cody/all/project.rb"
347
- - ".cody/all/role.rb"
348
362
  - ".cody/aws/bin/build.sh"
349
363
  - ".cody/aws/buildspec.yml"
364
+ - ".cody/aws/iam_role.rb"
350
365
  - ".cody/aws/project.rb"
351
- - ".cody/aws/role.rb"
352
366
  - ".cody/azurerm/bin/az/configure.sh"
353
367
  - ".cody/azurerm/bin/az/install.sh"
354
368
  - ".cody/azurerm/bin/build.sh"
355
369
  - ".cody/azurerm/bin/install.sh"
356
370
  - ".cody/azurerm/buildspec.yml"
371
+ - ".cody/azurerm/iam_role.rb"
357
372
  - ".cody/azurerm/project.rb"
358
- - ".cody/azurerm/role.rb"
359
373
  - ".cody/google/bin/build.sh"
360
374
  - ".cody/google/bin/gcloud/configure.sh"
361
375
  - ".cody/google/bin/gcloud/install.sh"
362
376
  - ".cody/google/bin/install.sh"
363
377
  - ".cody/google/buildspec.yml"
378
+ - ".cody/google/iam_role.rb"
364
379
  - ".cody/google/project.rb"
365
- - ".cody/google/role.rb"
366
380
  - ".cody/none/bin/build.sh"
367
381
  - ".cody/none/buildspec.yml"
382
+ - ".cody/none/iam_role.rb"
368
383
  - ".cody/none/project.rb"
369
- - ".cody/none/role.rb"
370
384
  - ".cody/shared/script/install.sh"
371
385
  - ".cody/shared/script/install/terraform.sh"
372
386
  - ".cody/shared/script/install/terraspace.sh"
387
+ - ".cody/shared/script/update/gemfile.sh"
373
388
  - ".cody/unit/bin/build.sh"
374
389
  - ".cody/unit/buildspec.yml"
375
390
  - ".cody/unit/project.rb"
@@ -382,7 +397,6 @@ files:
382
397
  - ".gitignore"
383
398
  - ".pipedream/README.md"
384
399
  - ".pipedream/pipeline.rb"
385
- - ".pipedream/schedule.rb"
386
400
  - ".rspec"
387
401
  - CHANGELOG.md
388
402
  - CONDUCT.md
@@ -424,49 +438,66 @@ files:
424
438
  - lib/templates/hcl/stack/main.tf
425
439
  - lib/templates/hcl/stack/outputs.tf
426
440
  - lib/templates/hcl/stack/variables.tf
427
- - lib/templates/plugin/.gitignore
428
- - lib/templates/plugin/.rspec
429
- - lib/templates/plugin/CHANGELOG.md
430
- - lib/templates/plugin/Gemfile
431
- - lib/templates/plugin/LICENSE.txt
432
- - lib/templates/plugin/README.md.tt
433
- - lib/templates/plugin/Rakefile
434
- - lib/templates/plugin/bin/console.tt
435
- - lib/templates/plugin/bin/setup
436
- - lib/templates/plugin/lib/templates/hcl/module/main.tf
437
- - lib/templates/plugin/lib/templates/hcl/module/outputs.tf
438
- - lib/templates/plugin/lib/templates/hcl/module/variables.tf
439
- - lib/templates/plugin/lib/templates/hcl/project/config/terraform/backend.tf.tt
440
- - lib/templates/plugin/lib/templates/hcl/project/config/terraform/provider.tf
441
- - lib/templates/plugin/lib/templates/hcl/stack/main.tf
442
- - lib/templates/plugin/lib/templates/hcl/stack/outputs.tf
443
- - lib/templates/plugin/lib/templates/hcl/stack/variables.tf
444
- - lib/templates/plugin/lib/templates/ruby/module/main.rb
445
- - lib/templates/plugin/lib/templates/ruby/module/outputs.rb
446
- - lib/templates/plugin/lib/templates/ruby/module/variables.rb
447
- - lib/templates/plugin/lib/templates/ruby/project/config/terraform/backend.rb.tt
448
- - lib/templates/plugin/lib/templates/ruby/project/config/terraform/provider.rb
449
- - lib/templates/plugin/lib/templates/ruby/stack/main.rb
450
- - lib/templates/plugin/lib/templates/ruby/stack/outputs.rb
451
- - lib/templates/plugin/lib/templates/ruby/stack/variables.rb
452
- - lib/templates/plugin/lib/templates/test/rspec/module/test/.rspec
453
- - lib/templates/plugin/lib/templates/test/rspec/module/test/Gemfile
454
- - lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/main.tf
455
- - lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf
456
- - lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf
457
- - lib/templates/plugin/lib/templates/test/rspec/module/test/spec/main_spec.rb
458
- - lib/templates/plugin/lib/templates/test/rspec/module/test/spec/spec_helper.rb
459
- - lib/templates/plugin/lib/terraspace_plugin_%name%.rb.tt
460
- - lib/templates/plugin/lib/terraspace_plugin_%name%/autoloader.rb.tt
461
- - lib/templates/plugin/lib/terraspace_plugin_%name%/clients.rb.tt
462
- - lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/backend.rb.tt
463
- - lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/config.rb.tt
464
- - lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/expander.rb.tt
465
- - lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/layer.rb.tt
466
- - lib/templates/plugin/lib/terraspace_plugin_%name%/version.rb.tt
467
- - lib/templates/plugin/spec/spec_helper.rb.tt
468
- - lib/templates/plugin/spec/terraspace_provider_%name%_spec.rb.tt
469
- - lib/templates/plugin/terraspace_plugin_%name%.gemspec.tt
441
+ - lib/templates/plugin/ci/%gem_name%.gemspec.tt
442
+ - lib/templates/plugin/ci/.gitignore
443
+ - lib/templates/plugin/ci/.rspec
444
+ - lib/templates/plugin/ci/.rubocop.yml
445
+ - lib/templates/plugin/ci/CHANGELOG.md.tt
446
+ - lib/templates/plugin/ci/Gemfile
447
+ - lib/templates/plugin/ci/LICENSE.txt
448
+ - lib/templates/plugin/ci/README.md.tt
449
+ - lib/templates/plugin/ci/Rakefile
450
+ - lib/templates/plugin/ci/lib/%gem_name%.rb.tt
451
+ - lib/templates/plugin/ci/lib/%gem_name%/autoloader.rb.tt
452
+ - lib/templates/plugin/ci/lib/%gem_name%/interface.rb.tt
453
+ - lib/templates/plugin/ci/lib/%gem_name%/pr.rb.tt
454
+ - lib/templates/plugin/ci/lib/%gem_name%/vars.rb.tt
455
+ - lib/templates/plugin/ci/lib/%gem_name%/version.rb.tt
456
+ - lib/templates/plugin/ci/spec/%gem_name%_spec.rb.tt
457
+ - lib/templates/plugin/ci/spec/spec_helper.rb.tt
458
+ - lib/templates/plugin/core/.gitignore
459
+ - lib/templates/plugin/core/.rspec
460
+ - lib/templates/plugin/core/CHANGELOG.md
461
+ - lib/templates/plugin/core/Gemfile
462
+ - lib/templates/plugin/core/LICENSE.txt
463
+ - lib/templates/plugin/core/README.md.tt
464
+ - lib/templates/plugin/core/Rakefile
465
+ - lib/templates/plugin/core/bin/console.tt
466
+ - lib/templates/plugin/core/bin/setup
467
+ - lib/templates/plugin/core/lib/templates/hcl/module/main.tf
468
+ - lib/templates/plugin/core/lib/templates/hcl/module/outputs.tf
469
+ - lib/templates/plugin/core/lib/templates/hcl/module/variables.tf
470
+ - lib/templates/plugin/core/lib/templates/hcl/project/config/terraform/backend.tf.tt
471
+ - lib/templates/plugin/core/lib/templates/hcl/project/config/terraform/provider.tf
472
+ - lib/templates/plugin/core/lib/templates/hcl/stack/main.tf
473
+ - lib/templates/plugin/core/lib/templates/hcl/stack/outputs.tf
474
+ - lib/templates/plugin/core/lib/templates/hcl/stack/variables.tf
475
+ - lib/templates/plugin/core/lib/templates/ruby/module/main.rb
476
+ - lib/templates/plugin/core/lib/templates/ruby/module/outputs.rb
477
+ - lib/templates/plugin/core/lib/templates/ruby/module/variables.rb
478
+ - lib/templates/plugin/core/lib/templates/ruby/project/config/terraform/backend.rb.tt
479
+ - lib/templates/plugin/core/lib/templates/ruby/project/config/terraform/provider.rb
480
+ - lib/templates/plugin/core/lib/templates/ruby/stack/main.rb
481
+ - lib/templates/plugin/core/lib/templates/ruby/stack/outputs.rb
482
+ - lib/templates/plugin/core/lib/templates/ruby/stack/variables.rb
483
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/.rspec
484
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/Gemfile
485
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/spec/fixtures/stack/main.tf
486
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf
487
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf
488
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/spec/main_spec.rb
489
+ - lib/templates/plugin/core/lib/templates/test/rspec/module/test/spec/spec_helper.rb
490
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%.rb.tt
491
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/autoloader.rb.tt
492
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/clients.rb.tt
493
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/interfaces/backend.rb.tt
494
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/interfaces/config.rb.tt
495
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/interfaces/expander.rb.tt
496
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/interfaces/layer.rb.tt
497
+ - lib/templates/plugin/core/lib/terraspace_plugin_%name%/version.rb.tt
498
+ - lib/templates/plugin/core/spec/spec_helper.rb.tt
499
+ - lib/templates/plugin/core/spec/terraspace_provider_%name%_spec.rb.tt
500
+ - lib/templates/plugin/core/terraspace_plugin_%name%.gemspec.tt
470
501
  - lib/templates/ruby/module/main.rb
471
502
  - lib/templates/ruby/module/outputs.rb
472
503
  - lib/templates/ruby/module/variables.rb
@@ -511,6 +542,7 @@ files:
511
542
  - lib/terraspace/cli/completer/script.rb
512
543
  - lib/terraspace/cli/completer/script.sh
513
544
  - lib/terraspace/cli/concern.rb
545
+ - lib/terraspace/cli/concerns/plan_path.rb
514
546
  - lib/terraspace/cli/concerns/source_dirs.rb
515
547
  - lib/terraspace/cli/down.rb
516
548
  - lib/terraspace/cli/fmt.rb
@@ -578,6 +610,7 @@ files:
578
610
  - lib/terraspace/cli/logs/concern.rb
579
611
  - lib/terraspace/cli/new.rb
580
612
  - lib/terraspace/cli/new/arg.rb
613
+ - lib/terraspace/cli/new/ci.rb
581
614
  - lib/terraspace/cli/new/example.rb
582
615
  - lib/terraspace/cli/new/git_hook.rb
583
616
  - lib/terraspace/cli/new/helper.rb
@@ -586,6 +619,8 @@ files:
586
619
  - lib/terraspace/cli/new/hook.rb
587
620
  - lib/terraspace/cli/new/module.rb
588
621
  - lib/terraspace/cli/new/plugin.rb
622
+ - lib/terraspace/cli/new/plugin/ci.rb
623
+ - lib/terraspace/cli/new/plugin/core.rb
589
624
  - lib/terraspace/cli/new/plugin/helper.rb
590
625
  - lib/terraspace/cli/new/project.rb
591
626
  - lib/terraspace/cli/new/sequence.rb
@@ -595,6 +630,7 @@ files:
595
630
  - lib/terraspace/cli/new/source/test.rb
596
631
  - lib/terraspace/cli/new/stack.rb
597
632
  - lib/terraspace/cli/new/test.rb
633
+ - lib/terraspace/cli/plan.rb
598
634
  - lib/terraspace/cli/seed.rb
599
635
  - lib/terraspace/cli/setup.rb
600
636
  - lib/terraspace/cli/setup/check.rb
@@ -605,6 +641,30 @@ files:
605
641
  - lib/terraspace/cli/tfc/runs.rb
606
642
  - lib/terraspace/cli/tfc_concern.rb
607
643
  - lib/terraspace/cli/up.rb
644
+ - lib/terraspace/cloud/api.rb
645
+ - lib/terraspace/cloud/api/cani.rb
646
+ - lib/terraspace/cloud/api/concern.rb
647
+ - lib/terraspace/cloud/api/concern/errors.rb
648
+ - lib/terraspace/cloud/api/concern/record.rb
649
+ - lib/terraspace/cloud/api/http_methods.rb
650
+ - lib/terraspace/cloud/api/validate.rb
651
+ - lib/terraspace/cloud/base.rb
652
+ - lib/terraspace/cloud/ci.rb
653
+ - lib/terraspace/cloud/ci/generic.rb
654
+ - lib/terraspace/cloud/ci/manual.rb
655
+ - lib/terraspace/cloud/ci/vcs.rb
656
+ - lib/terraspace/cloud/ci/vcs/base.rb
657
+ - lib/terraspace/cloud/ci/vcs/bitbucket.rb
658
+ - lib/terraspace/cloud/ci/vcs/github.rb
659
+ - lib/terraspace/cloud/ci/vcs/gitlab.rb
660
+ - lib/terraspace/cloud/context.rb
661
+ - lib/terraspace/cloud/folder.rb
662
+ - lib/terraspace/cloud/folder/base.rb
663
+ - lib/terraspace/cloud/folder/package.rb
664
+ - lib/terraspace/cloud/folder/tidy.rb
665
+ - lib/terraspace/cloud/folder/uploader.rb
666
+ - lib/terraspace/cloud/plan.rb
667
+ - lib/terraspace/cloud/update.rb
608
668
  - lib/terraspace/command.rb
609
669
  - lib/terraspace/compiler/basename.rb
610
670
  - lib/terraspace/compiler/cleaner.rb
@@ -713,8 +773,12 @@ files:
713
773
  - lib/terraspace/terraform/args/pass.rb
714
774
  - lib/terraspace/terraform/args/shorthands.rb
715
775
  - lib/terraspace/terraform/args/thor.rb
776
+ - lib/terraspace/terraform/ihooks/after/apply.rb
777
+ - lib/terraspace/terraform/ihooks/after/destroy.rb
716
778
  - lib/terraspace/terraform/ihooks/after/plan.rb
717
779
  - lib/terraspace/terraform/ihooks/base.rb
780
+ - lib/terraspace/terraform/ihooks/before/apply.rb
781
+ - lib/terraspace/terraform/ihooks/before/destroy.rb
718
782
  - lib/terraspace/terraform/ihooks/before/plan.rb
719
783
  - lib/terraspace/terraform/remote_state/fetcher.rb
720
784
  - lib/terraspace/terraform/remote_state/marker/output.rb
@@ -893,7 +957,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
893
957
  - !ruby/object:Gem::Version
894
958
  version: '0'
895
959
  requirements: []
896
- rubygems_version: 3.2.32
960
+ rubygems_version: 3.3.12
897
961
  signing_key:
898
962
  specification_version: 4
899
963
  summary: 'Terraspace: The Terraspace Framework'
@@ -1,3 +0,0 @@
1
- # rate "1 day"
2
- # or
3
- cron("0 10 * * ? *") # Run at 10:00 am (UTC) every day