terraspace 0.0.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/README.md +25 -0
  3. data/.cody/aws/bin/build.sh +13 -0
  4. data/.cody/aws/buildspec.yml +10 -0
  5. data/.cody/aws/project.rb +2 -0
  6. data/.cody/aws/role.rb +6 -0
  7. data/.cody/azurerm/bin/az/configure.sh +23 -0
  8. data/.cody/azurerm/bin/az/install.sh +17 -0
  9. data/.cody/azurerm/bin/build.sh +20 -0
  10. data/.cody/azurerm/bin/install.sh +6 -0
  11. data/.cody/azurerm/buildspec.yml +11 -0
  12. data/.cody/azurerm/project.rb +2 -0
  13. data/.cody/azurerm/role.rb +5 -0
  14. data/.cody/google/bin/build.sh +17 -0
  15. data/.cody/google/bin/gcloud/configure.sh +15 -0
  16. data/.cody/google/bin/gcloud/install.sh +18 -0
  17. data/.cody/google/bin/install.sh +6 -0
  18. data/.cody/google/buildspec.yml +11 -0
  19. data/.cody/google/project.rb +2 -0
  20. data/.cody/google/role.rb +5 -0
  21. data/.cody/shared/script/install.sh +6 -0
  22. data/.cody/shared/script/install/terraform.sh +11 -0
  23. data/.cody/shared/script/install/terraspace.sh +72 -0
  24. data/.cody/unit/bin/build.sh +4 -0
  25. data/.cody/unit/buildspec.yml +9 -0
  26. data/.cody/unit/project.rb +2 -0
  27. data/.github/ISSUE_TEMPLATE.md +7 -0
  28. data/.github/ISSUE_TEMPLATE/bug_report.md +84 -0
  29. data/.github/ISSUE_TEMPLATE/documentation.md +12 -0
  30. data/.github/ISSUE_TEMPLATE/feature_request.md +64 -0
  31. data/.github/ISSUE_TEMPLATE/question.md +14 -0
  32. data/.github/PULL_REQUEST_TEMPLATE.md +50 -0
  33. data/.gitignore +18 -9
  34. data/.pipedream/README.md +25 -0
  35. data/.pipedream/pipeline.rb +17 -0
  36. data/.pipedream/schedule.rb +3 -0
  37. data/.rspec +2 -2
  38. data/CHANGELOG.md +37 -0
  39. data/CONDUCT.md +1 -0
  40. data/CONTRIBUTING.md +1 -0
  41. data/Gemfile +1 -4
  42. data/Guardfile +19 -0
  43. data/LICENSE.txt +201 -21
  44. data/README.md +62 -27
  45. data/Rakefile +10 -2
  46. data/exe/terraspace +14 -0
  47. data/lib/templates/base/git_hook/hook.sh +5 -0
  48. data/lib/templates/base/project/.gitignore +33 -0
  49. data/lib/templates/base/project/Gemfile.tt +9 -0
  50. data/lib/templates/base/project/Terrafile +14 -0
  51. data/lib/templates/base/project/config/app.rb +4 -0
  52. data/lib/templates/base/shim/terraspace +7 -0
  53. data/lib/templates/hcl/module/main.tf +1 -0
  54. data/lib/templates/hcl/module/outputs.tf +1 -0
  55. data/lib/templates/hcl/module/variables.tf +1 -0
  56. data/lib/templates/hcl/project/config/terraform/backend.tf.tt +18 -0
  57. data/lib/templates/hcl/project/config/terraform/provider.tf +16 -0
  58. data/lib/templates/hcl/stack/main.tf +1 -0
  59. data/lib/templates/hcl/stack/outputs.tf +1 -0
  60. data/lib/templates/hcl/stack/variables.tf +1 -0
  61. data/lib/templates/plugin/.gitignore +12 -0
  62. data/lib/templates/plugin/.rspec +3 -0
  63. data/lib/templates/plugin/CHANGELOG.md +7 -0
  64. data/lib/templates/plugin/Gemfile +7 -0
  65. data/lib/templates/plugin/LICENSE.txt +201 -0
  66. data/lib/templates/plugin/README.md.tt +34 -0
  67. data/lib/templates/plugin/Rakefile +6 -0
  68. data/{bin/console → lib/templates/plugin/bin/console.tt} +1 -1
  69. data/{bin → lib/templates/plugin/bin}/setup +0 -0
  70. data/lib/templates/plugin/lib/templates/hcl/module/main.tf +1 -0
  71. data/lib/templates/plugin/lib/templates/hcl/module/outputs.tf +1 -0
  72. data/lib/templates/plugin/lib/templates/hcl/module/variables.tf +1 -0
  73. data/lib/templates/plugin/lib/templates/hcl/project/config/terraform/backend.tf.tt +6 -0
  74. data/lib/templates/plugin/lib/templates/hcl/project/config/terraform/provider.tf +3 -0
  75. data/lib/templates/plugin/lib/templates/hcl/stack/main.tf +1 -0
  76. data/lib/templates/plugin/lib/templates/hcl/stack/outputs.tf +1 -0
  77. data/lib/templates/plugin/lib/templates/hcl/stack/variables.tf +1 -0
  78. data/lib/templates/plugin/lib/templates/ruby/module/main.rb +1 -0
  79. data/lib/templates/plugin/lib/templates/ruby/module/outputs.rb +1 -0
  80. data/lib/templates/plugin/lib/templates/ruby/module/variables.rb +1 -0
  81. data/lib/templates/plugin/lib/templates/ruby/project/config/terraform/backend.rb.tt +4 -0
  82. data/lib/templates/plugin/lib/templates/ruby/project/config/terraform/provider.rb +3 -0
  83. data/lib/templates/plugin/lib/templates/ruby/stack/main.rb +1 -0
  84. data/lib/templates/plugin/lib/templates/ruby/stack/outputs.rb +1 -0
  85. data/lib/templates/plugin/lib/templates/ruby/stack/variables.rb +1 -0
  86. data/lib/templates/plugin/lib/templates/test/rspec/module/test/.rspec +3 -0
  87. data/lib/templates/plugin/lib/templates/test/rspec/module/test/Gemfile +9 -0
  88. data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/main.tf +1 -0
  89. data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf +1 -0
  90. data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf +1 -0
  91. data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/main_spec.rb +29 -0
  92. data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/spec_helper.rb +13 -0
  93. data/lib/templates/plugin/lib/terraspace_plugin_%name%.rb.tt +36 -0
  94. data/lib/templates/plugin/lib/terraspace_plugin_%name%/autoloader.rb.tt +23 -0
  95. data/lib/templates/plugin/lib/terraspace_plugin_%name%/clients.rb.tt +14 -0
  96. data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/backend.rb.tt +12 -0
  97. data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/config.rb.tt +18 -0
  98. data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/expander.rb.tt +15 -0
  99. data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/layer.rb.tt +20 -0
  100. data/lib/templates/plugin/lib/terraspace_plugin_%name%/version.rb.tt +3 -0
  101. data/lib/templates/plugin/spec/spec_helper.rb.tt +14 -0
  102. data/lib/templates/plugin/spec/terraspace_provider_%name%_spec.rb.tt +5 -0
  103. data/lib/templates/plugin/terraspace_plugin_%name%.gemspec.tt +27 -0
  104. data/lib/templates/ruby/module/main.rb +1 -0
  105. data/lib/templates/ruby/module/outputs.rb +1 -0
  106. data/lib/templates/ruby/module/variables.rb +1 -0
  107. data/lib/templates/ruby/project/config/terraform/backend.rb.tt +9 -0
  108. data/lib/templates/ruby/project/config/terraform/provider.rb +7 -0
  109. data/lib/templates/ruby/stack/main.rb +1 -0
  110. data/lib/templates/ruby/stack/outputs.rb +1 -0
  111. data/lib/templates/ruby/stack/variables.rb +1 -0
  112. data/lib/terraspace.rb +22 -1
  113. data/lib/terraspace/app.rb +36 -0
  114. data/lib/terraspace/app/hooks.rb +18 -0
  115. data/lib/terraspace/autoloader.rb +25 -0
  116. data/lib/terraspace/booter.rb +19 -0
  117. data/lib/terraspace/builder.rb +43 -0
  118. data/lib/terraspace/bundle.rb +54 -0
  119. data/lib/terraspace/cli.rb +202 -0
  120. data/lib/terraspace/cli/base.rb +11 -0
  121. data/lib/terraspace/cli/build/placeholder.rb +40 -0
  122. data/lib/terraspace/cli/bundle.rb +28 -0
  123. data/lib/terraspace/cli/check_setup.rb +73 -0
  124. data/lib/terraspace/cli/clean.rb +12 -0
  125. data/lib/terraspace/cli/cloud.rb +24 -0
  126. data/lib/terraspace/cli/commander.rb +21 -0
  127. data/lib/terraspace/cli/help.rb +11 -0
  128. data/lib/terraspace/cli/help/bundle.md +14 -0
  129. data/lib/terraspace/cli/help/completion.md +20 -0
  130. data/lib/terraspace/cli/help/completion_script.md +3 -0
  131. data/lib/terraspace/cli/help/update.md +5 -0
  132. data/lib/terraspace/cli/info.rb +30 -0
  133. data/lib/terraspace/cli/init.rb +67 -0
  134. data/lib/terraspace/cli/list.rb +13 -0
  135. data/lib/terraspace/cli/new.rb +40 -0
  136. data/lib/terraspace/cli/new/git_hook.rb +33 -0
  137. data/lib/terraspace/cli/new/helper.rb +15 -0
  138. data/lib/terraspace/cli/new/helper/plugin_gem.rb +12 -0
  139. data/lib/terraspace/cli/new/module.rb +26 -0
  140. data/lib/terraspace/cli/new/plugin.rb +20 -0
  141. data/lib/terraspace/cli/new/plugin/helper.rb +15 -0
  142. data/lib/terraspace/cli/new/project.rb +110 -0
  143. data/lib/terraspace/cli/new/sequence.rb +59 -0
  144. data/lib/terraspace/cli/new/shim.rb +58 -0
  145. data/lib/terraspace/cli/new/source/core.rb +63 -0
  146. data/lib/terraspace/cli/new/source/plugin.rb +20 -0
  147. data/lib/terraspace/cli/new/source/test.rb +26 -0
  148. data/lib/terraspace/cli/new/stack.rb +26 -0
  149. data/lib/terraspace/cli/new/test/base.rb +17 -0
  150. data/lib/terraspace/cli/new/test/bootstrap.rb +18 -0
  151. data/lib/terraspace/cli/new/test/module.rb +15 -0
  152. data/lib/terraspace/cli/new/test/project.rb +15 -0
  153. data/lib/terraspace/cli/seed.rb +9 -0
  154. data/lib/terraspace/cli/summary.rb +58 -0
  155. data/lib/terraspace/cli/test.rb +35 -0
  156. data/lib/terraspace/command.rb +100 -0
  157. data/lib/terraspace/compiler/backend.rb +38 -0
  158. data/lib/terraspace/compiler/backend/parser.rb +42 -0
  159. data/lib/terraspace/compiler/basename.rb +10 -0
  160. data/lib/terraspace/compiler/builder.rb +78 -0
  161. data/lib/terraspace/compiler/cleaner.rb +63 -0
  162. data/lib/terraspace/compiler/cleaner/backend_change.rb +45 -0
  163. data/lib/terraspace/compiler/dsl/base.rb +12 -0
  164. data/lib/terraspace/compiler/dsl/meta/local.rb +7 -0
  165. data/lib/terraspace/compiler/dsl/meta/var.rb +7 -0
  166. data/lib/terraspace/compiler/dsl/mod.rb +19 -0
  167. data/lib/terraspace/compiler/dsl/syntax/helpers/common.rb +28 -0
  168. data/lib/terraspace/compiler/dsl/syntax/mod.rb +7 -0
  169. data/lib/terraspace/compiler/dsl/syntax/mod/backend.rb +31 -0
  170. data/lib/terraspace/compiler/dsl/syntax/mod/data.rb +9 -0
  171. data/lib/terraspace/compiler/dsl/syntax/mod/locals.rb +7 -0
  172. data/lib/terraspace/compiler/dsl/syntax/mod/module.rb +10 -0
  173. data/lib/terraspace/compiler/dsl/syntax/mod/output.rb +8 -0
  174. data/lib/terraspace/compiler/dsl/syntax/mod/provider.rb +8 -0
  175. data/lib/terraspace/compiler/dsl/syntax/mod/resource.rb +24 -0
  176. data/lib/terraspace/compiler/dsl/syntax/mod/terraform.rb +8 -0
  177. data/lib/terraspace/compiler/dsl/syntax/mod/variable.rb +12 -0
  178. data/lib/terraspace/compiler/dsl/syntax/tfvar.rb +5 -0
  179. data/lib/terraspace/compiler/dsl/syntax/tfvar/common.rb +7 -0
  180. data/lib/terraspace/compiler/dsl/tfvars.rb +29 -0
  181. data/lib/terraspace/compiler/erb/context.rb +11 -0
  182. data/lib/terraspace/compiler/erb/render.rb +12 -0
  183. data/lib/terraspace/compiler/expander.rb +46 -0
  184. data/lib/terraspace/compiler/strategy/abstract_base.rb +7 -0
  185. data/lib/terraspace/compiler/strategy/mod.rb +15 -0
  186. data/lib/terraspace/compiler/strategy/mod/base.rb +4 -0
  187. data/lib/terraspace/compiler/strategy/mod/pass.rb +7 -0
  188. data/lib/terraspace/compiler/strategy/mod/rb.rb +7 -0
  189. data/lib/terraspace/compiler/strategy/mod/tf.rb +7 -0
  190. data/lib/terraspace/compiler/strategy/tfvar.rb +42 -0
  191. data/lib/terraspace/compiler/strategy/tfvar/base.rb +4 -0
  192. data/lib/terraspace/compiler/strategy/tfvar/layer.rb +110 -0
  193. data/lib/terraspace/compiler/strategy/tfvar/rb.rb +7 -0
  194. data/lib/terraspace/compiler/strategy/tfvar/tfvars.rb +7 -0
  195. data/lib/terraspace/compiler/writer.rb +36 -0
  196. data/lib/terraspace/completer.rb +159 -0
  197. data/lib/terraspace/completer/script.rb +6 -0
  198. data/lib/terraspace/completer/script.sh +10 -0
  199. data/lib/terraspace/core.rb +52 -0
  200. data/lib/terraspace/ext.rb +2 -0
  201. data/lib/terraspace/ext/bundler.rb +7 -0
  202. data/lib/terraspace/ext/core/module.rb +19 -0
  203. data/lib/terraspace/logger.rb +26 -0
  204. data/lib/terraspace/mod.rb +125 -0
  205. data/lib/terraspace/mod/remote.rb +18 -0
  206. data/lib/terraspace/plugin.rb +73 -0
  207. data/lib/terraspace/plugin/backend/interface.rb +8 -0
  208. data/lib/terraspace/plugin/config/interface.rb +27 -0
  209. data/lib/terraspace/plugin/decorator/interface.rb +8 -0
  210. data/lib/terraspace/plugin/expander/generic.rb +5 -0
  211. data/lib/terraspace/plugin/expander/interface.rb +95 -0
  212. data/lib/terraspace/plugin/finder.rb +45 -0
  213. data/lib/terraspace/plugin/infer_provider.rb +15 -0
  214. data/lib/terraspace/plugin/layer/interface.rb +5 -0
  215. data/lib/terraspace/plugin/meta.rb +29 -0
  216. data/lib/terraspace/plugin/summary/interface.rb +130 -0
  217. data/lib/terraspace/seeder.rb +66 -0
  218. data/lib/terraspace/seeder/actions.rb +24 -0
  219. data/lib/terraspace/seeder/content.rb +84 -0
  220. data/lib/terraspace/seeder/where.rb +30 -0
  221. data/lib/terraspace/terraform/api.rb +53 -0
  222. data/lib/terraspace/terraform/api/client.rb +10 -0
  223. data/lib/terraspace/terraform/api/http.rb +106 -0
  224. data/lib/terraspace/terraform/api/var.rb +72 -0
  225. data/lib/terraspace/terraform/api/vars.rb +38 -0
  226. data/lib/terraspace/terraform/api/vars/base.rb +7 -0
  227. data/lib/terraspace/terraform/api/vars/json.rb +14 -0
  228. data/lib/terraspace/terraform/api/vars/rb.rb +21 -0
  229. data/lib/terraspace/terraform/args/custom.rb +47 -0
  230. data/lib/terraspace/terraform/args/default.rb +110 -0
  231. data/lib/terraspace/terraform/args/dsl.rb +30 -0
  232. data/lib/terraspace/terraform/args/shorthands.rb +47 -0
  233. data/lib/terraspace/terraform/cloud.rb +25 -0
  234. data/lib/terraspace/terraform/cloud/workspace.rb +95 -0
  235. data/lib/terraspace/terraform/hooks/builder.rb +40 -0
  236. data/lib/terraspace/terraform/hooks/dsl.rb +19 -0
  237. data/lib/terraspace/terraform/runner.rb +77 -0
  238. data/lib/terraspace/tester.rb +29 -0
  239. data/lib/terraspace/tester/finder.rb +25 -0
  240. data/lib/terraspace/tester/meta.rb +25 -0
  241. data/lib/terraspace/util.rb +13 -0
  242. data/lib/terraspace/util/logging.rb +7 -0
  243. data/lib/terraspace/util/sh.rb +19 -0
  244. data/lib/terraspace/util/sure.rb +22 -0
  245. data/lib/terraspace/version.rb +1 -1
  246. data/spec/cli_spec.rb +13 -0
  247. data/spec/fixtures/cache_dir/variables.tf +9 -0
  248. data/spec/fixtures/initialized/modules.json +29 -0
  249. data/spec/fixtures/orphans/config/backend.rb +8 -0
  250. data/spec/fixtures/orphans/config/provider.rb +3 -0
  251. data/spec/fixtures/orphans/config/providers_different.rb +6 -0
  252. data/spec/fixtures/orphans/config/providers_same.rb +16 -0
  253. data/spec/fixtures/orphans/data/aws_ami.rb +8 -0
  254. data/spec/fixtures/orphans/data/aws_instance.rb +16 -0
  255. data/spec/fixtures/orphans/locals/forum.rb +4 -0
  256. data/spec/fixtures/orphans/locals/qux.rb +7 -0
  257. data/spec/fixtures/orphans/module/core/main.rb +5 -0
  258. data/spec/fixtures/orphans/resource/security_group/hash_example.rb +18 -0
  259. data/spec/fixtures/orphans/resource/vpc/count_example.rb +7 -0
  260. data/spec/fixtures/orphans/terraform/terraform.rb +3 -0
  261. data/spec/fixtures/projects/hcl/aws/app/modules/instance/main.tf +30 -0
  262. data/spec/fixtures/projects/hcl/aws/app/modules/instance/variables.tf +7 -0
  263. data/spec/fixtures/projects/hcl/aws/app/modules/vpc/file.txt +1 -0
  264. data/spec/fixtures/projects/hcl/aws/app/modules/vpc/main.tf +7 -0
  265. data/spec/fixtures/projects/hcl/aws/app/modules/vpc/variables.tf +11 -0
  266. data/spec/fixtures/projects/hcl/aws/app/stacks/core/main.tf +3 -0
  267. data/spec/fixtures/projects/hcl/aws/app/stacks/monolith/main.tf +3 -0
  268. data/spec/fixtures/projects/hcl/aws/config/backend.tf +9 -0
  269. data/spec/fixtures/projects/hcl/aws/config/provider.tf +3 -0
  270. data/spec/fixtures/projects/hcl/google/app/modules/vpc/main.tf +4 -0
  271. data/spec/fixtures/projects/hcl/google/app/modules/vpc/outputs.tf +4 -0
  272. data/spec/fixtures/projects/hcl/google/app/modules/vpc/variables.tf +5 -0
  273. data/spec/fixtures/projects/hcl/google/config/backend.tf +6 -0
  274. data/spec/fixtures/projects/hcl/google/config/provider.tf +0 -0
  275. data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/backend.rb +7 -0
  276. data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/main.rb +7 -0
  277. data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/outputs.rb +4 -0
  278. data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/variables.rb +9 -0
  279. data/spec/fixtures/projects/ruby/aws/app/modules/instance/main.rb +28 -0
  280. data/spec/fixtures/projects/ruby/aws/app/modules/instance/outputs.rb +3 -0
  281. data/spec/fixtures/projects/ruby/aws/app/modules/instance/variables.rb +7 -0
  282. data/spec/fixtures/projects/ruby/aws/app/modules/security_group/main.rb +16 -0
  283. data/spec/fixtures/projects/ruby/aws/app/modules/security_group/variables.rb +5 -0
  284. data/spec/fixtures/projects/ruby/aws/app/modules/sg_child/main.rb +7 -0
  285. data/spec/fixtures/projects/ruby/aws/app/modules/sg_child/variables.rb +5 -0
  286. data/spec/fixtures/projects/ruby/aws/app/modules/sg_parent/main.rb +14 -0
  287. data/spec/fixtures/projects/ruby/aws/app/modules/sg_parent/variables.rb +3 -0
  288. data/spec/fixtures/projects/ruby/aws/app/modules/vpc/main.rb +7 -0
  289. data/spec/fixtures/projects/ruby/aws/app/modules/vpc/outputs.rb +4 -0
  290. data/spec/fixtures/projects/ruby/aws/app/modules/vpc/variables.rb +9 -0
  291. data/spec/fixtures/projects/ruby/aws/app/modules/wordpress/main.rb +0 -0
  292. data/spec/fixtures/projects/ruby/aws/app/stacks/core/a.tfvars +0 -0
  293. data/spec/fixtures/projects/ruby/aws/app/stacks/core/b.tfvars +1 -0
  294. data/spec/fixtures/projects/ruby/aws/app/stacks/core/main.rb +6 -0
  295. data/spec/fixtures/projects/ruby/aws/app/stacks/core/outputs.rb +4 -0
  296. data/spec/fixtures/projects/ruby/aws/app/stacks/core/variables.rb +2 -0
  297. data/spec/fixtures/projects/ruby/aws/app/stacks/gke/main.rb +0 -0
  298. data/spec/fixtures/projects/ruby/aws/app/stacks/monolith/main.rb +3 -0
  299. data/spec/fixtures/projects/ruby/aws/app/stacks/nested/main.rb +5 -0
  300. data/spec/fixtures/projects/ruby/aws/config/backend.rb +7 -0
  301. data/spec/fixtures/projects/ruby/aws/config/cli/args.rb +11 -0
  302. data/spec/fixtures/projects/ruby/aws/config/cli/hooks.rb +8 -0
  303. data/spec/fixtures/projects/ruby/aws/config/provider.rb +3 -0
  304. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/instance/base.rb +1 -0
  305. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/instance/dev.rb +1 -0
  306. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/instance/prod.rb +0 -0
  307. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/security_group/base.rb +1 -0
  308. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/security_group/dev.rb +1 -0
  309. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/vpc/base.tfvars +2 -0
  310. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/vpc/dev.tfvars +1 -0
  311. data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/vpc/prod.tfvars +1 -0
  312. data/spec/fixtures/projects/ruby/aws/seed/tfvars/stacks/core/base.rb +4 -0
  313. data/spec/fixtures/projects/ruby/aws/seed/tfvars/stacks/core/dev.rb +1 -0
  314. data/spec/fixtures/projects/ruby/aws/seed/tfvars/stacks/core/prod.rb +1 -0
  315. data/spec/fixtures/projects/ruby/aws/vendor/modules/vpc/main.rb +7 -0
  316. data/spec/fixtures/projects/ruby/aws/vendor/modules/vpc/outputs.rb +4 -0
  317. data/spec/fixtures/projects/ruby/aws/vendor/modules/vpc/variables.rb +9 -0
  318. data/spec/fixtures/projects/ruby/google/app/modules/firewall/main.rb +17 -0
  319. data/spec/fixtures/projects/ruby/google/app/modules/network/main.rb +4 -0
  320. data/spec/fixtures/projects/ruby/google/app/modules/vm-simple/main.rb +28 -0
  321. data/spec/fixtures/projects/ruby/google/app/modules/vm/main.rb +32 -0
  322. data/spec/fixtures/projects/ruby/google/app/modules/vm/outputs.rb +3 -0
  323. data/spec/fixtures/projects/ruby/google/app/modules/vm/variables.rb +19 -0
  324. data/spec/fixtures/projects/ruby/google/app/stacks/core/main.rb +5 -0
  325. data/spec/fixtures/projects/ruby/google/config/backend.rb +4 -0
  326. data/spec/fixtures/projects/ruby/google/config/provider.rb +14 -0
  327. data/spec/fixtures/terraform/args/multiple.rb +4 -0
  328. data/spec/fixtures/terraform/args/single.rb +10 -0
  329. data/spec/fixtures/terraform/hooks/multiple.rb +3 -0
  330. data/spec/fixtures/terraform/hooks/single.rb +7 -0
  331. data/spec/spec_helper.rb +32 -0
  332. data/spec/terraspace/compiler/dsl/backend_spec.rb +33 -0
  333. data/spec/terraspace/compiler/dsl/data_spec.rb +30 -0
  334. data/spec/terraspace/compiler/dsl/locals_spec.rb +44 -0
  335. data/spec/terraspace/compiler/dsl/meta/local_spec.rb +10 -0
  336. data/spec/terraspace/compiler/dsl/meta/var_spec.rb +10 -0
  337. data/spec/terraspace/compiler/dsl/module_spec.rb +14 -0
  338. data/spec/terraspace/compiler/dsl/monolith_spec.rb +23 -0
  339. data/spec/terraspace/compiler/dsl/output_spec.rb +22 -0
  340. data/spec/terraspace/compiler/dsl/provider_spec.rb +72 -0
  341. data/spec/terraspace/compiler/dsl/resource/security_group_spec.rb +43 -0
  342. data/spec/terraspace/compiler/dsl/resource_spec.rb +64 -0
  343. data/spec/terraspace/compiler/dsl/terraform_spec.rb +21 -0
  344. data/spec/terraspace/compiler/dsl/variable_spec.rb +28 -0
  345. data/spec/terraspace/provider/expander/generic_spec.rb +30 -0
  346. data/spec/terraspace/seeder/content_spec.rb +49 -0
  347. data/spec/terraspace/seeder_spec.rb +20 -0
  348. data/spec/terraspace/terraform/args/custom_spec.rb +48 -0
  349. data/spec/terraspace/terraform/hooks/builder_spec.rb +35 -0
  350. data/terraspace.gemspec +32 -15
  351. metadata +721 -14
  352. data/.travis.yml +0 -6
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: Documentation
3
+ about: Found a typo or something that isn't crystal clear in the docs?
4
+ title: ''
5
+ labels: docs
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ The Terraspace Docs are in the [terraspace-docs repo](https://github.com/boltops-tools/terraspace-docs). Please submit a PR there. Thanks!
11
+
12
+ For documentation changes to the terraspace code base itself, like code comments. Please submit a PR here. Thanks!
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: New Feature Suggestion
3
+ about: Want to add a feature to Terraspace?
4
+ title: ''
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ Hi! Thanks for considering to file a feature request with Terraspace. Please take the time to answer the basic questions. Please try to be as detailed as possible.
12
+
13
+ Thanks!
14
+ -->
15
+
16
+ ## Summary
17
+
18
+ <!--
19
+ A one-paragraph explanation of the feature.
20
+ -->
21
+
22
+ ## Motivation
23
+
24
+ <!--
25
+ Why do you want to see this feature in Terraspace? What use cases does it support?
26
+
27
+ How the feature would be relevant to 80% or more of Terraspace users.
28
+ -->
29
+
30
+ ## Guide-level explanation
31
+
32
+ <!--
33
+ Explain the proposal as if it was already included in the project and you were teaching it to another programmer. That generally means:
34
+
35
+ - Introducing new named concepts.
36
+ - Explaining the feature largely in terms of examples.
37
+ - If applicable, provide sample error messages, deprecation warnings, or upgrade guidance.
38
+
39
+ If this is a small feature, you may omit this section.
40
+ -->
41
+
42
+ ## Reference-level explanation
43
+
44
+ <!--
45
+ This is the technical portion of the feature request. Explain the design in sufficient detail that:
46
+
47
+ - Its interaction with other features is clear.
48
+ - It is reasonably clear how the feature would be implemented.
49
+ - Corner cases are dissected by example.
50
+
51
+ If you do not know how to answer this, you can omit it. No worries!
52
+ -->
53
+
54
+ ## Drawbacks
55
+
56
+ <!--
57
+ Why should we *not* do this?
58
+ -->
59
+
60
+ ## Unresolved Questions
61
+
62
+ <!--
63
+ What related issues do you consider out of scope for this feature that could be addressed in the future independently of the solution that comes out of this feature?
64
+ -->
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Question
3
+ about: Have any questions about how Terraspace works?
4
+ title: ''
5
+ labels: 'question'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ The Terraspace issue tracker IS NOT for usage questions! Please post your question at sites like StackOverflow.
11
+
12
+ To be sensitive to everyone's time, we may close issues asking questions without comment. If you repeatedly post questions in the issues tracker, you may be blocked from ever submitting issues to Terraspace again. Please use your best judgment. 👍
13
+
14
+ Here are some additional options also https://terraspace.cloud/support/ 😁
@@ -0,0 +1,50 @@
1
+ <!--
2
+ Thanks for creating a Pull Request! Before you submit, please make sure you've done the following:
3
+
4
+ - I read the contributing document at https://terraspace.cloud/docs/contributing/
5
+ -->
6
+
7
+ <!--
8
+ Make our lives easier! Choose one of the following by uncommenting it:
9
+ -->
10
+
11
+ <!-- This is a 🐞 bug fix. -->
12
+ <!-- This is a 🙋‍♂️ feature or enhancement. -->
13
+ <!-- This is a 🧐 documentation change. -->
14
+
15
+ <!--
16
+ Before you submit this pull request, make sure to have a look at the following checklist. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
17
+
18
+ If you don't know how to do some of these, that's fine! Submit your pull request and we will help you out on the way.
19
+ -->
20
+
21
+ - [ ] I've added tests (if it's a bug, feature or enhancement)
22
+ - [ ] I've adjusted the documentation (if it's a feature or enhancement)
23
+ - [ ] The test suite passes (run `bundle exec rspec` to verify this)
24
+
25
+ ## Summary
26
+
27
+ <!--
28
+ Provide a description of what your pull request changes.
29
+ -->
30
+
31
+ ## Context
32
+
33
+ <!--
34
+ Is this related to any GitHub issue(s) or another relevant link?
35
+ -->
36
+
37
+ ## How to Test
38
+
39
+ <!--
40
+ Please provide instructions on how to test the fix. This speeds up reviewing the PR. If testing requires a demo Terraspace project, please provide an example repo.
41
+ -->
42
+
43
+
44
+ ## Version Changes
45
+
46
+ <!--
47
+ Which semantic version change would you recommend?
48
+ If you don't know, feel free to omit it.
49
+ -->
50
+
data/.gitignore CHANGED
@@ -1,11 +1,20 @@
1
- /.bundle/
1
+ *.gem
2
+ *.rbc
3
+ .terraspace-cache
4
+ /.bundle
5
+ /.config
2
6
  /.yardoc
3
- /_yardoc/
4
- /coverage/
7
+ /_yardoc
8
+ /coverage
5
9
  /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
10
+ /Gemfile.lock
11
+ /InstalledFiles
12
+ /lib/bundler/man
13
+ /output
14
+ /pkg
15
+ /rdoc
16
+ /spec/fixtures/project/output
17
+ /spec/reports
18
+ /test/tmp
19
+ /test/version_tmp
20
+ /tmp
@@ -0,0 +1,25 @@
1
+ # Pipedream Files
2
+
3
+ The files in folder are used by pipedream to build AWS CodePipeline pipelines. For more info, check out the [pipedream docs](https://pipedream.run). Here's a quick start.
4
+
5
+ ## Install Tool
6
+
7
+ gem install pipedream
8
+
9
+ This installs both the `pipe` and `pipedream` commands. They do the same thing, the `pipe` command is just shorter to type.
10
+
11
+ ## Update Project
12
+
13
+ To update the CodePipeline pipelines:
14
+
15
+ pipedream deploy
16
+
17
+ ## Start a Execution
18
+
19
+ To start a CodePipeline execution:
20
+
21
+ pipedream start
22
+
23
+ To specify a branch:
24
+
25
+ pipedream start -b feature
@@ -0,0 +1,17 @@
1
+ stage "Source" do
2
+ github(
3
+ source: "boltops-tools/terraspace",
4
+ # branch: "master", # branch defaults to "master" or the `pipe deploy --branch` option
5
+ auth_token: ssm("/github/boltopsbot/token")
6
+ )
7
+ end
8
+
9
+ stage "Build" do
10
+ # in parallel
11
+ codebuild(
12
+ "terraspace-aws",
13
+ "terraspace-azurerm",
14
+ "terraspace-google",
15
+ "terraspace-unit",
16
+ )
17
+ end
@@ -0,0 +1,3 @@
1
+ # rate "1 day"
2
+ # or
3
+ cron("0 10 * * ? *") # Run at 10:00 am (UTC) every day
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
2
- --color
3
1
  --require spec_helper
2
+ --color
3
+ --format documentation
@@ -0,0 +1,37 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
+
6
+ ## [0.2.1]
7
+ * #35 fix summary bug when ran multiple times with different envs
8
+
9
+ ## [0.2.0]
10
+ * #34 Terraform Cloud and Terraform Enterprise support added.
11
+ * TFC Vars support: JSON and DSL. config.overwrite and config.overwrite_sensitive configs
12
+ * Build all stacks with config/terraform files. Designed to support the TFC VCS-driven workflow.
13
+ * Layer Interface module added. All latest provider plugins like terraspace\_plugin_aws make use of this module.
14
+ * Backend pattern expansion auto-detects the provider bakcend. The `expansion` method replaces the `backend_expand` method. `backend_expand` is deprecated.
15
+ * New expander variables: TYPE_INSTANCE, INSTANCE, CACHE_ROOT. Also added strip trailing - and / behavior.
16
+ * Timeout for terraform init. The default timeout is 10m and will then print out the terraform init log.
17
+ * Terraspace 0.2.x is compatible with terraspace\_plugin_aws 0.2.x, terraspace\_plugin_google 0.2.x, and terraspace\_plugin_azurerm 0.2.x
18
+ * New commands: terraspace list, terraspace cloud list, terraspace cloud setup, terraspace cloud destroy, terraspace new shim, terraspace new git_hook
19
+ * terraspace list: list of modules and stacks
20
+ * terraspace cloud list: shows list of TFC workspaces
21
+ * terraspace cloud setup: setups up TFC workspace for VCS-driven workflow. This automatically happens for the TFC CLI-driven workflow.
22
+ * terraspace cloud destroy: destroys the TFC workspace associated with the stack. Can also use the `terraspace down demo --destroy-workspace` option.
23
+ * terraspace new shim: An quick way to generate a terraspace shim.
24
+ * terraspace new git_hook: An quick way to set up a git pre-push hook for the TFC VCS-driven workflow.
25
+ * terraspace down: works even if there's no app/stacks folder. A fake stack is built.
26
+ * terraspace build: terraspace build placeholder concept.
27
+ * terraspace build: only builds now. auto bucket backend creation and terraform init is is still automatically called by terraform up, etc.
28
+ * terraspace up: --reconfigure option. This is useful if upgrading Terraform version.
29
+
30
+ ## [0.1.2]
31
+ * #33 rspec-terraspace dependency added
32
+
33
+ ## [0.1.1]
34
+ * #32 terraspace summary --short option
35
+
36
+ ## [0.1.0]
37
+ * Initial release
@@ -0,0 +1 @@
1
+ https://terraspace.cloud/docs/conduct/
@@ -0,0 +1 @@
1
+ https://terraspace.cloud/docs/contributing/
data/Gemfile CHANGED
@@ -1,7 +1,4 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in terraspace.gemspec
3
+ # Specify your gem dependencies in terraspace.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
@@ -0,0 +1,19 @@
1
+ guard "bundler", cmd: "bundle" do
2
+ watch("Gemfile")
3
+ watch(/^.+\.gemspec/)
4
+ end
5
+
6
+ guard :rspec, cmd: "bundle exec rspec" do
7
+ require "guard/rspec/dsl"
8
+ dsl = Guard::RSpec::Dsl.new(self)
9
+
10
+ # RSpec files
11
+ rspec = dsl.rspec
12
+ watch(rspec.spec_helper) { rspec.spec_dir }
13
+ watch(rspec.spec_support) { rspec.spec_dir }
14
+ watch(rspec.spec_files)
15
+
16
+ # Ruby files
17
+ ruby = dsl.ruby
18
+ dsl.watch_spec_files_for(ruby.lib_files)
19
+ end
@@ -1,21 +1,201 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 Tung Nguyen
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.