terraspace 0.0.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cody/README.md +25 -0
- data/.cody/aws/bin/build.sh +13 -0
- data/.cody/aws/buildspec.yml +10 -0
- data/.cody/aws/project.rb +2 -0
- data/.cody/aws/role.rb +6 -0
- data/.cody/azurerm/bin/az/configure.sh +23 -0
- data/.cody/azurerm/bin/az/install.sh +17 -0
- data/.cody/azurerm/bin/build.sh +20 -0
- data/.cody/azurerm/bin/install.sh +6 -0
- data/.cody/azurerm/buildspec.yml +11 -0
- data/.cody/azurerm/project.rb +2 -0
- data/.cody/azurerm/role.rb +5 -0
- data/.cody/google/bin/build.sh +17 -0
- data/.cody/google/bin/gcloud/configure.sh +15 -0
- data/.cody/google/bin/gcloud/install.sh +18 -0
- data/.cody/google/bin/install.sh +6 -0
- data/.cody/google/buildspec.yml +11 -0
- data/.cody/google/project.rb +2 -0
- data/.cody/google/role.rb +5 -0
- data/.cody/shared/script/install.sh +6 -0
- data/.cody/shared/script/install/terraform.sh +11 -0
- data/.cody/shared/script/install/terraspace.sh +72 -0
- data/.cody/unit/bin/build.sh +4 -0
- data/.cody/unit/buildspec.yml +9 -0
- data/.cody/unit/project.rb +2 -0
- data/.github/ISSUE_TEMPLATE.md +7 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +84 -0
- data/.github/ISSUE_TEMPLATE/documentation.md +12 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +64 -0
- data/.github/ISSUE_TEMPLATE/question.md +14 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +50 -0
- data/.gitignore +18 -9
- data/.pipedream/README.md +25 -0
- data/.pipedream/pipeline.rb +17 -0
- data/.pipedream/schedule.rb +3 -0
- data/.rspec +2 -2
- data/CHANGELOG.md +37 -0
- data/CONDUCT.md +1 -0
- data/CONTRIBUTING.md +1 -0
- data/Gemfile +1 -4
- data/Guardfile +19 -0
- data/LICENSE.txt +201 -21
- data/README.md +62 -27
- data/Rakefile +10 -2
- data/exe/terraspace +14 -0
- data/lib/templates/base/git_hook/hook.sh +5 -0
- data/lib/templates/base/project/.gitignore +33 -0
- data/lib/templates/base/project/Gemfile.tt +9 -0
- data/lib/templates/base/project/Terrafile +14 -0
- data/lib/templates/base/project/config/app.rb +4 -0
- data/lib/templates/base/shim/terraspace +7 -0
- data/lib/templates/hcl/module/main.tf +1 -0
- data/lib/templates/hcl/module/outputs.tf +1 -0
- data/lib/templates/hcl/module/variables.tf +1 -0
- data/lib/templates/hcl/project/config/terraform/backend.tf.tt +18 -0
- data/lib/templates/hcl/project/config/terraform/provider.tf +16 -0
- data/lib/templates/hcl/stack/main.tf +1 -0
- data/lib/templates/hcl/stack/outputs.tf +1 -0
- data/lib/templates/hcl/stack/variables.tf +1 -0
- data/lib/templates/plugin/.gitignore +12 -0
- data/lib/templates/plugin/.rspec +3 -0
- data/lib/templates/plugin/CHANGELOG.md +7 -0
- data/lib/templates/plugin/Gemfile +7 -0
- data/lib/templates/plugin/LICENSE.txt +201 -0
- data/lib/templates/plugin/README.md.tt +34 -0
- data/lib/templates/plugin/Rakefile +6 -0
- data/{bin/console → lib/templates/plugin/bin/console.tt} +1 -1
- data/{bin → lib/templates/plugin/bin}/setup +0 -0
- data/lib/templates/plugin/lib/templates/hcl/module/main.tf +1 -0
- data/lib/templates/plugin/lib/templates/hcl/module/outputs.tf +1 -0
- data/lib/templates/plugin/lib/templates/hcl/module/variables.tf +1 -0
- data/lib/templates/plugin/lib/templates/hcl/project/config/terraform/backend.tf.tt +6 -0
- data/lib/templates/plugin/lib/templates/hcl/project/config/terraform/provider.tf +3 -0
- data/lib/templates/plugin/lib/templates/hcl/stack/main.tf +1 -0
- data/lib/templates/plugin/lib/templates/hcl/stack/outputs.tf +1 -0
- data/lib/templates/plugin/lib/templates/hcl/stack/variables.tf +1 -0
- data/lib/templates/plugin/lib/templates/ruby/module/main.rb +1 -0
- data/lib/templates/plugin/lib/templates/ruby/module/outputs.rb +1 -0
- data/lib/templates/plugin/lib/templates/ruby/module/variables.rb +1 -0
- data/lib/templates/plugin/lib/templates/ruby/project/config/terraform/backend.rb.tt +4 -0
- data/lib/templates/plugin/lib/templates/ruby/project/config/terraform/provider.rb +3 -0
- data/lib/templates/plugin/lib/templates/ruby/stack/main.rb +1 -0
- data/lib/templates/plugin/lib/templates/ruby/stack/outputs.rb +1 -0
- data/lib/templates/plugin/lib/templates/ruby/stack/variables.rb +1 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/.rspec +3 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/Gemfile +9 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/main.tf +1 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/outputs.tf +1 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/fixtures/stack/variables.tf +1 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/main_spec.rb +29 -0
- data/lib/templates/plugin/lib/templates/test/rspec/module/test/spec/spec_helper.rb +13 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%.rb.tt +36 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/autoloader.rb.tt +23 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/clients.rb.tt +14 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/backend.rb.tt +12 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/config.rb.tt +18 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/expander.rb.tt +15 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/interfaces/layer.rb.tt +20 -0
- data/lib/templates/plugin/lib/terraspace_plugin_%name%/version.rb.tt +3 -0
- data/lib/templates/plugin/spec/spec_helper.rb.tt +14 -0
- data/lib/templates/plugin/spec/terraspace_provider_%name%_spec.rb.tt +5 -0
- data/lib/templates/plugin/terraspace_plugin_%name%.gemspec.tt +27 -0
- data/lib/templates/ruby/module/main.rb +1 -0
- data/lib/templates/ruby/module/outputs.rb +1 -0
- data/lib/templates/ruby/module/variables.rb +1 -0
- data/lib/templates/ruby/project/config/terraform/backend.rb.tt +9 -0
- data/lib/templates/ruby/project/config/terraform/provider.rb +7 -0
- data/lib/templates/ruby/stack/main.rb +1 -0
- data/lib/templates/ruby/stack/outputs.rb +1 -0
- data/lib/templates/ruby/stack/variables.rb +1 -0
- data/lib/terraspace.rb +22 -1
- data/lib/terraspace/app.rb +36 -0
- data/lib/terraspace/app/hooks.rb +18 -0
- data/lib/terraspace/autoloader.rb +25 -0
- data/lib/terraspace/booter.rb +19 -0
- data/lib/terraspace/builder.rb +43 -0
- data/lib/terraspace/bundle.rb +54 -0
- data/lib/terraspace/cli.rb +202 -0
- data/lib/terraspace/cli/base.rb +11 -0
- data/lib/terraspace/cli/build/placeholder.rb +40 -0
- data/lib/terraspace/cli/bundle.rb +28 -0
- data/lib/terraspace/cli/check_setup.rb +73 -0
- data/lib/terraspace/cli/clean.rb +12 -0
- data/lib/terraspace/cli/cloud.rb +24 -0
- data/lib/terraspace/cli/commander.rb +21 -0
- data/lib/terraspace/cli/help.rb +11 -0
- data/lib/terraspace/cli/help/bundle.md +14 -0
- data/lib/terraspace/cli/help/completion.md +20 -0
- data/lib/terraspace/cli/help/completion_script.md +3 -0
- data/lib/terraspace/cli/help/update.md +5 -0
- data/lib/terraspace/cli/info.rb +30 -0
- data/lib/terraspace/cli/init.rb +67 -0
- data/lib/terraspace/cli/list.rb +13 -0
- data/lib/terraspace/cli/new.rb +40 -0
- data/lib/terraspace/cli/new/git_hook.rb +33 -0
- data/lib/terraspace/cli/new/helper.rb +15 -0
- data/lib/terraspace/cli/new/helper/plugin_gem.rb +12 -0
- data/lib/terraspace/cli/new/module.rb +26 -0
- data/lib/terraspace/cli/new/plugin.rb +20 -0
- data/lib/terraspace/cli/new/plugin/helper.rb +15 -0
- data/lib/terraspace/cli/new/project.rb +110 -0
- data/lib/terraspace/cli/new/sequence.rb +59 -0
- data/lib/terraspace/cli/new/shim.rb +58 -0
- data/lib/terraspace/cli/new/source/core.rb +63 -0
- data/lib/terraspace/cli/new/source/plugin.rb +20 -0
- data/lib/terraspace/cli/new/source/test.rb +26 -0
- data/lib/terraspace/cli/new/stack.rb +26 -0
- data/lib/terraspace/cli/new/test/base.rb +17 -0
- data/lib/terraspace/cli/new/test/bootstrap.rb +18 -0
- data/lib/terraspace/cli/new/test/module.rb +15 -0
- data/lib/terraspace/cli/new/test/project.rb +15 -0
- data/lib/terraspace/cli/seed.rb +9 -0
- data/lib/terraspace/cli/summary.rb +58 -0
- data/lib/terraspace/cli/test.rb +35 -0
- data/lib/terraspace/command.rb +100 -0
- data/lib/terraspace/compiler/backend.rb +38 -0
- data/lib/terraspace/compiler/backend/parser.rb +42 -0
- data/lib/terraspace/compiler/basename.rb +10 -0
- data/lib/terraspace/compiler/builder.rb +78 -0
- data/lib/terraspace/compiler/cleaner.rb +63 -0
- data/lib/terraspace/compiler/cleaner/backend_change.rb +45 -0
- data/lib/terraspace/compiler/dsl/base.rb +12 -0
- data/lib/terraspace/compiler/dsl/meta/local.rb +7 -0
- data/lib/terraspace/compiler/dsl/meta/var.rb +7 -0
- data/lib/terraspace/compiler/dsl/mod.rb +19 -0
- data/lib/terraspace/compiler/dsl/syntax/helpers/common.rb +28 -0
- data/lib/terraspace/compiler/dsl/syntax/mod.rb +7 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/backend.rb +31 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/data.rb +9 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/locals.rb +7 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/module.rb +10 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/output.rb +8 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/provider.rb +8 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/resource.rb +24 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/terraform.rb +8 -0
- data/lib/terraspace/compiler/dsl/syntax/mod/variable.rb +12 -0
- data/lib/terraspace/compiler/dsl/syntax/tfvar.rb +5 -0
- data/lib/terraspace/compiler/dsl/syntax/tfvar/common.rb +7 -0
- data/lib/terraspace/compiler/dsl/tfvars.rb +29 -0
- data/lib/terraspace/compiler/erb/context.rb +11 -0
- data/lib/terraspace/compiler/erb/render.rb +12 -0
- data/lib/terraspace/compiler/expander.rb +46 -0
- data/lib/terraspace/compiler/strategy/abstract_base.rb +7 -0
- data/lib/terraspace/compiler/strategy/mod.rb +15 -0
- data/lib/terraspace/compiler/strategy/mod/base.rb +4 -0
- data/lib/terraspace/compiler/strategy/mod/pass.rb +7 -0
- data/lib/terraspace/compiler/strategy/mod/rb.rb +7 -0
- data/lib/terraspace/compiler/strategy/mod/tf.rb +7 -0
- data/lib/terraspace/compiler/strategy/tfvar.rb +42 -0
- data/lib/terraspace/compiler/strategy/tfvar/base.rb +4 -0
- data/lib/terraspace/compiler/strategy/tfvar/layer.rb +110 -0
- data/lib/terraspace/compiler/strategy/tfvar/rb.rb +7 -0
- data/lib/terraspace/compiler/strategy/tfvar/tfvars.rb +7 -0
- data/lib/terraspace/compiler/writer.rb +36 -0
- data/lib/terraspace/completer.rb +159 -0
- data/lib/terraspace/completer/script.rb +6 -0
- data/lib/terraspace/completer/script.sh +10 -0
- data/lib/terraspace/core.rb +52 -0
- data/lib/terraspace/ext.rb +2 -0
- data/lib/terraspace/ext/bundler.rb +7 -0
- data/lib/terraspace/ext/core/module.rb +19 -0
- data/lib/terraspace/logger.rb +26 -0
- data/lib/terraspace/mod.rb +125 -0
- data/lib/terraspace/mod/remote.rb +18 -0
- data/lib/terraspace/plugin.rb +73 -0
- data/lib/terraspace/plugin/backend/interface.rb +8 -0
- data/lib/terraspace/plugin/config/interface.rb +27 -0
- data/lib/terraspace/plugin/decorator/interface.rb +8 -0
- data/lib/terraspace/plugin/expander/generic.rb +5 -0
- data/lib/terraspace/plugin/expander/interface.rb +95 -0
- data/lib/terraspace/plugin/finder.rb +45 -0
- data/lib/terraspace/plugin/infer_provider.rb +15 -0
- data/lib/terraspace/plugin/layer/interface.rb +5 -0
- data/lib/terraspace/plugin/meta.rb +29 -0
- data/lib/terraspace/plugin/summary/interface.rb +130 -0
- data/lib/terraspace/seeder.rb +66 -0
- data/lib/terraspace/seeder/actions.rb +24 -0
- data/lib/terraspace/seeder/content.rb +84 -0
- data/lib/terraspace/seeder/where.rb +30 -0
- data/lib/terraspace/terraform/api.rb +53 -0
- data/lib/terraspace/terraform/api/client.rb +10 -0
- data/lib/terraspace/terraform/api/http.rb +106 -0
- data/lib/terraspace/terraform/api/var.rb +72 -0
- data/lib/terraspace/terraform/api/vars.rb +38 -0
- data/lib/terraspace/terraform/api/vars/base.rb +7 -0
- data/lib/terraspace/terraform/api/vars/json.rb +14 -0
- data/lib/terraspace/terraform/api/vars/rb.rb +21 -0
- data/lib/terraspace/terraform/args/custom.rb +47 -0
- data/lib/terraspace/terraform/args/default.rb +110 -0
- data/lib/terraspace/terraform/args/dsl.rb +30 -0
- data/lib/terraspace/terraform/args/shorthands.rb +47 -0
- data/lib/terraspace/terraform/cloud.rb +25 -0
- data/lib/terraspace/terraform/cloud/workspace.rb +95 -0
- data/lib/terraspace/terraform/hooks/builder.rb +40 -0
- data/lib/terraspace/terraform/hooks/dsl.rb +19 -0
- data/lib/terraspace/terraform/runner.rb +77 -0
- data/lib/terraspace/tester.rb +29 -0
- data/lib/terraspace/tester/finder.rb +25 -0
- data/lib/terraspace/tester/meta.rb +25 -0
- data/lib/terraspace/util.rb +13 -0
- data/lib/terraspace/util/logging.rb +7 -0
- data/lib/terraspace/util/sh.rb +19 -0
- data/lib/terraspace/util/sure.rb +22 -0
- data/lib/terraspace/version.rb +1 -1
- data/spec/cli_spec.rb +13 -0
- data/spec/fixtures/cache_dir/variables.tf +9 -0
- data/spec/fixtures/initialized/modules.json +29 -0
- data/spec/fixtures/orphans/config/backend.rb +8 -0
- data/spec/fixtures/orphans/config/provider.rb +3 -0
- data/spec/fixtures/orphans/config/providers_different.rb +6 -0
- data/spec/fixtures/orphans/config/providers_same.rb +16 -0
- data/spec/fixtures/orphans/data/aws_ami.rb +8 -0
- data/spec/fixtures/orphans/data/aws_instance.rb +16 -0
- data/spec/fixtures/orphans/locals/forum.rb +4 -0
- data/spec/fixtures/orphans/locals/qux.rb +7 -0
- data/spec/fixtures/orphans/module/core/main.rb +5 -0
- data/spec/fixtures/orphans/resource/security_group/hash_example.rb +18 -0
- data/spec/fixtures/orphans/resource/vpc/count_example.rb +7 -0
- data/spec/fixtures/orphans/terraform/terraform.rb +3 -0
- data/spec/fixtures/projects/hcl/aws/app/modules/instance/main.tf +30 -0
- data/spec/fixtures/projects/hcl/aws/app/modules/instance/variables.tf +7 -0
- data/spec/fixtures/projects/hcl/aws/app/modules/vpc/file.txt +1 -0
- data/spec/fixtures/projects/hcl/aws/app/modules/vpc/main.tf +7 -0
- data/spec/fixtures/projects/hcl/aws/app/modules/vpc/variables.tf +11 -0
- data/spec/fixtures/projects/hcl/aws/app/stacks/core/main.tf +3 -0
- data/spec/fixtures/projects/hcl/aws/app/stacks/monolith/main.tf +3 -0
- data/spec/fixtures/projects/hcl/aws/config/backend.tf +9 -0
- data/spec/fixtures/projects/hcl/aws/config/provider.tf +3 -0
- data/spec/fixtures/projects/hcl/google/app/modules/vpc/main.tf +4 -0
- data/spec/fixtures/projects/hcl/google/app/modules/vpc/outputs.tf +4 -0
- data/spec/fixtures/projects/hcl/google/app/modules/vpc/variables.tf +5 -0
- data/spec/fixtures/projects/hcl/google/config/backend.tf +6 -0
- data/spec/fixtures/projects/hcl/google/config/provider.tf +0 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/backend.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/main.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/outputs.rb +4 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/existing_backend/variables.rb +9 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/instance/main.rb +28 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/instance/outputs.rb +3 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/instance/variables.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/security_group/main.rb +16 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/security_group/variables.rb +5 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/sg_child/main.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/sg_child/variables.rb +5 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/sg_parent/main.rb +14 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/sg_parent/variables.rb +3 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/vpc/main.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/vpc/outputs.rb +4 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/vpc/variables.rb +9 -0
- data/spec/fixtures/projects/ruby/aws/app/modules/wordpress/main.rb +0 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/core/a.tfvars +0 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/core/b.tfvars +1 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/core/main.rb +6 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/core/outputs.rb +4 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/core/variables.rb +2 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/gke/main.rb +0 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/monolith/main.rb +3 -0
- data/spec/fixtures/projects/ruby/aws/app/stacks/nested/main.rb +5 -0
- data/spec/fixtures/projects/ruby/aws/config/backend.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/config/cli/args.rb +11 -0
- data/spec/fixtures/projects/ruby/aws/config/cli/hooks.rb +8 -0
- data/spec/fixtures/projects/ruby/aws/config/provider.rb +3 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/instance/base.rb +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/instance/dev.rb +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/instance/prod.rb +0 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/security_group/base.rb +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/security_group/dev.rb +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/vpc/base.tfvars +2 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/vpc/dev.tfvars +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/modules/vpc/prod.tfvars +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/stacks/core/base.rb +4 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/stacks/core/dev.rb +1 -0
- data/spec/fixtures/projects/ruby/aws/seed/tfvars/stacks/core/prod.rb +1 -0
- data/spec/fixtures/projects/ruby/aws/vendor/modules/vpc/main.rb +7 -0
- data/spec/fixtures/projects/ruby/aws/vendor/modules/vpc/outputs.rb +4 -0
- data/spec/fixtures/projects/ruby/aws/vendor/modules/vpc/variables.rb +9 -0
- data/spec/fixtures/projects/ruby/google/app/modules/firewall/main.rb +17 -0
- data/spec/fixtures/projects/ruby/google/app/modules/network/main.rb +4 -0
- data/spec/fixtures/projects/ruby/google/app/modules/vm-simple/main.rb +28 -0
- data/spec/fixtures/projects/ruby/google/app/modules/vm/main.rb +32 -0
- data/spec/fixtures/projects/ruby/google/app/modules/vm/outputs.rb +3 -0
- data/spec/fixtures/projects/ruby/google/app/modules/vm/variables.rb +19 -0
- data/spec/fixtures/projects/ruby/google/app/stacks/core/main.rb +5 -0
- data/spec/fixtures/projects/ruby/google/config/backend.rb +4 -0
- data/spec/fixtures/projects/ruby/google/config/provider.rb +14 -0
- data/spec/fixtures/terraform/args/multiple.rb +4 -0
- data/spec/fixtures/terraform/args/single.rb +10 -0
- data/spec/fixtures/terraform/hooks/multiple.rb +3 -0
- data/spec/fixtures/terraform/hooks/single.rb +7 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/terraspace/compiler/dsl/backend_spec.rb +33 -0
- data/spec/terraspace/compiler/dsl/data_spec.rb +30 -0
- data/spec/terraspace/compiler/dsl/locals_spec.rb +44 -0
- data/spec/terraspace/compiler/dsl/meta/local_spec.rb +10 -0
- data/spec/terraspace/compiler/dsl/meta/var_spec.rb +10 -0
- data/spec/terraspace/compiler/dsl/module_spec.rb +14 -0
- data/spec/terraspace/compiler/dsl/monolith_spec.rb +23 -0
- data/spec/terraspace/compiler/dsl/output_spec.rb +22 -0
- data/spec/terraspace/compiler/dsl/provider_spec.rb +72 -0
- data/spec/terraspace/compiler/dsl/resource/security_group_spec.rb +43 -0
- data/spec/terraspace/compiler/dsl/resource_spec.rb +64 -0
- data/spec/terraspace/compiler/dsl/terraform_spec.rb +21 -0
- data/spec/terraspace/compiler/dsl/variable_spec.rb +28 -0
- data/spec/terraspace/provider/expander/generic_spec.rb +30 -0
- data/spec/terraspace/seeder/content_spec.rb +49 -0
- data/spec/terraspace/seeder_spec.rb +20 -0
- data/spec/terraspace/terraform/args/custom_spec.rb +48 -0
- data/spec/terraspace/terraform/hooks/builder_spec.rb +35 -0
- data/terraspace.gemspec +32 -15
- metadata +721 -14
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a1cb3e8dfc7d02eae24d3e81a7e0a10033c9aa5890c41e77b35c29d84cc65c6
|
4
|
+
data.tar.gz: 31d1dce8f2c88b8d5548ba1e93ae7038d60b672b9a7e950cea5422ff504a5203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb5bad6aca8391331b16131d20289d847ecd7c19ad5d4e22e9bda785937367c02b94ecab70132b2e157a88a6761012a3049a01ed1defb4aaf91f7dfb0e7a9b25
|
7
|
+
data.tar.gz: 41dbfa2e0323cf7cfdc7cb3dd26278a109fbc4f1c8133ef7f3cf92aa9d146825ff777fbb0e5755284a12d6df77f94f13bbaff525849d1b642306dc452bda1cdb
|
data/.cody/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Cody Files
|
2
|
+
|
3
|
+
The files in folder are used by cody to build AWS CodeBuild projects. For more info, check out the [cody docs](https://cody.run). Here's a quick start.
|
4
|
+
|
5
|
+
## Install Tool
|
6
|
+
|
7
|
+
gem install cody
|
8
|
+
|
9
|
+
This installs the `cody` command to manage the AWS CodeBuild project.
|
10
|
+
|
11
|
+
## Update Project
|
12
|
+
|
13
|
+
cody deploy --type aws
|
14
|
+
|
15
|
+
## Start a Deploy
|
16
|
+
|
17
|
+
To start a CodeBuild build:
|
18
|
+
|
19
|
+
cody start --type aws
|
20
|
+
cody start --type azurerm
|
21
|
+
cody start --type google
|
22
|
+
|
23
|
+
To specify a branch:
|
24
|
+
|
25
|
+
cody start --type aws -b feature
|
data/.cody/aws/role.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eux
|
4
|
+
|
5
|
+
mkdir -p ~/.azure
|
6
|
+
aws secretsmanager get-secret-value --secret-id terraspace/azure-client | jq -r '.SecretString | fromjson' > ~/.azure/app-client.json
|
7
|
+
|
8
|
+
# ~/.azure/app-client.json
|
9
|
+
export ARM_CLIENT_ID=$(cat ~/.azure/app-client.json | jq -r '.client_id')
|
10
|
+
export ARM_CLIENT_SECRET=$(cat ~/.azure/app-client.json | jq -r '.client_secret')
|
11
|
+
export ARM_SUBSCRIPTION_ID=$(cat ~/.azure/app-client.json | jq -r '.subscription_id')
|
12
|
+
export ARM_TENANT_ID=$(cat ~/.azure/app-client.json | jq -r '.tenant_id')
|
13
|
+
|
14
|
+
# non-interactive login with service principal
|
15
|
+
az login --service-principal \
|
16
|
+
--username $ARM_CLIENT_ID \
|
17
|
+
--password $ARM_CLIENT_SECRET \
|
18
|
+
--tenant $ARM_TENANT_ID
|
19
|
+
|
20
|
+
git clone https://github.com/boltops-tools/azure_check.git
|
21
|
+
cd azure_check
|
22
|
+
bundle install
|
23
|
+
ruby azure_check.rb
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?view=azure-cli-latest
|
6
|
+
# Doesnt seem to have non-interactive install mode
|
7
|
+
# Workaround: https://github.com/Azure/azure-cli/issues/3376
|
8
|
+
export PATH=$PATH:~/.local/bin
|
9
|
+
pip install --user azure-cli --quiet
|
10
|
+
az --version
|
11
|
+
|
12
|
+
cat << 'EOF' > /usr/local/bin/az
|
13
|
+
export PATH=~/.local/bin:$PATH
|
14
|
+
exec az "$@"
|
15
|
+
EOF
|
16
|
+
|
17
|
+
chmod a+x /usr/local/bin/az
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
# cwd: /codebuild/output/src438337164/src/github.com/boltops-tools/terraspace
|
6
|
+
# will build from /tmp because terraspace/Gemfile may interfere
|
7
|
+
cd /tmp
|
8
|
+
|
9
|
+
export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
|
10
|
+
|
11
|
+
# ~/.azure/app-client.json
|
12
|
+
export ARM_CLIENT_ID=$(cat ~/.azure/app-client.json | jq -r '.client_id')
|
13
|
+
export ARM_CLIENT_SECRET=$(cat ~/.azure/app-client.json | jq -r '.client_secret')
|
14
|
+
export ARM_SUBSCRIPTION_ID=$(cat ~/.azure/app-client.json | jq -r '.subscription_id')
|
15
|
+
export ARM_TENANT_ID=$(cat ~/.azure/app-client.json | jq -r '.tenant_id')
|
16
|
+
|
17
|
+
set -x
|
18
|
+
terraspace new project infra --examples --plugin azurerm
|
19
|
+
cd infra
|
20
|
+
terraspace test
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
# will build from /tmp because terraspace/Gemfile may interfere
|
6
|
+
cd /tmp
|
7
|
+
|
8
|
+
export PATH=~/bin:$PATH # ~/bin/terraspace wrapper
|
9
|
+
|
10
|
+
# ~/.gcp/credentials.json
|
11
|
+
export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/credentials.json
|
12
|
+
export GOOGLE_PROJECT=$(cat $GOOGLE_APPLICATION_CREDENTIALS | jq -r '.project_id')
|
13
|
+
|
14
|
+
set -x
|
15
|
+
terraspace new project infra --examples --plugin google
|
16
|
+
cd infra
|
17
|
+
terraspace test
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
mkdir -p ~/.gcp
|
6
|
+
aws secretsmanager get-secret-value --secret-id terraspace/gcloud-credentials | jq '.SecretString | fromjson' > ~/.gcp/credentials.json
|
7
|
+
|
8
|
+
# ~/.gcp/credentials.json
|
9
|
+
export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/credentials.json
|
10
|
+
export GOOGLE_PROJECT=$(cat $GOOGLE_APPLICATION_CREDENTIALS | jq -r '.project_id')
|
11
|
+
|
12
|
+
gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS
|
13
|
+
gcloud config set project $GOOGLE_PROJECT
|
14
|
+
gcloud compute zones list --filter=region:us-central1
|
15
|
+
gcloud --version
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
# https://cloud.google.com/sdk/docs/downloads-interactive?hl=ru#linux
|
6
|
+
# Non-interactive (silent) deployment
|
7
|
+
export PATH=~/google-cloud-sdk/bin:$PATH
|
8
|
+
curl https://sdk.cloud.google.com > install.sh
|
9
|
+
bash install.sh --disable-prompts
|
10
|
+
gcloud --version
|
11
|
+
|
12
|
+
cat << 'EOF' > /usr/local/bin/gcloud
|
13
|
+
#!/bin/bash
|
14
|
+
export PATH=~/google-cloud-sdk/bin:$PATH
|
15
|
+
exec gcloud "$@"
|
16
|
+
EOF
|
17
|
+
|
18
|
+
chmod a+x /usr/local/bin/gcloud
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
TERRAFORM_VERSION=0.12.26
|
6
|
+
|
7
|
+
mkdir /tmp/terraform
|
8
|
+
cd /tmp/terraform
|
9
|
+
wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
|
10
|
+
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip
|
11
|
+
mv terraform /usr/local/bin
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eux
|
4
|
+
|
5
|
+
export PATH=~/bin:$PATH
|
6
|
+
|
7
|
+
cat << 'EOF' > ~/.gemrc
|
8
|
+
---
|
9
|
+
:backtrace: false
|
10
|
+
:bulk_threshold: 1000
|
11
|
+
:sources:
|
12
|
+
- https://rubygems.org
|
13
|
+
:update_sources: true
|
14
|
+
:verbose: true
|
15
|
+
benchmark: false
|
16
|
+
install: "--no-ri --no-rdoc --no-document"
|
17
|
+
update: "--no-ri --no-rdoc --no-document"
|
18
|
+
EOF
|
19
|
+
|
20
|
+
# Order matters, terraspace install must come at the end
|
21
|
+
# Normally, user installs terraspace which in turn will install the gem dependencies.
|
22
|
+
# But we want to install the edge versions here, not the already release gems.
|
23
|
+
# We install the gem dependencies first to achieve this
|
24
|
+
gems="
|
25
|
+
rspec-terraspace
|
26
|
+
terraspace_plugin_aws
|
27
|
+
terraspace_plugin_azurerm
|
28
|
+
terraspace_plugin_google
|
29
|
+
"
|
30
|
+
|
31
|
+
function setup() {
|
32
|
+
local name=$1
|
33
|
+
if [ -d $name ]; then
|
34
|
+
cd $name
|
35
|
+
git pull
|
36
|
+
else
|
37
|
+
git clone https://github.com/boltops-tools/$name
|
38
|
+
cd $name
|
39
|
+
|
40
|
+
git submodule update --init
|
41
|
+
fi
|
42
|
+
|
43
|
+
bundle install # --without development test
|
44
|
+
rake install
|
45
|
+
cd -
|
46
|
+
}
|
47
|
+
|
48
|
+
mkdir -p ~/environment/terraspace-edge
|
49
|
+
cd ~/environment/terraspace-edge
|
50
|
+
for i in $gems ; do
|
51
|
+
setup $i
|
52
|
+
done
|
53
|
+
|
54
|
+
# Ready to go back to the original terraspace source and install terraspace
|
55
|
+
cd $CODEBUILD_SRC_DIR # terraspace folder
|
56
|
+
bundle install
|
57
|
+
rake install
|
58
|
+
|
59
|
+
mkdir -p ~/bin
|
60
|
+
cat << EOF > ~/bin/terraspace
|
61
|
+
#!/bin/bash
|
62
|
+
# If there's a Gemfile, assume we're in a terraspace project with a Gemfile for terraspace
|
63
|
+
if [ -f Gemfile ]; then
|
64
|
+
exec bundle exec $CODEBUILD_SRC_DIR/exe/terraspace "\$@"
|
65
|
+
else
|
66
|
+
exec $CODEBUILD_SRC_DIR/exe/terraspace "\$@"
|
67
|
+
fi
|
68
|
+
EOF
|
69
|
+
|
70
|
+
cat ~/bin/terraspace
|
71
|
+
|
72
|
+
chmod a+x ~/bin/terraspace
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Please fill out one of the templates on https://github.com/boltops-tools/terraspace/issues/new/choose
|
2
|
+
|
3
|
+
If you want to ask a question please do so on sites like StackOverflow.
|
4
|
+
|
5
|
+
To be sensitive to everyone's time, we may close issues asking questions without comment. Here are some additional options also https://terraspace.cloud/docs/support/ 👌
|
6
|
+
|
7
|
+
Thank you!
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
name: Reproducible Bug Report
|
3
|
+
about: Is something not working as expected?
|
4
|
+
title: ''
|
5
|
+
labels: 'bug'
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
<!--
|
11
|
+
Hi! Thanks for considering to file a bug with Terraspace. Please take the time to
|
12
|
+
answer the basic questions. Please try to be as detailed as possible.
|
13
|
+
To be sensitive to everyone's time, if not enough details are provided, the
|
14
|
+
issue may be closed without comment. If you repeatedly fail to provide enough
|
15
|
+
details, you may be blocked from ever submitting issues to Terraspace again.
|
16
|
+
Please use your best judgment. 👍
|
17
|
+
|
18
|
+
If you are unsure this is a bug in Terraspace, please consider asking your question at sites like StackOverflow.
|
19
|
+
|
20
|
+
Thanks!
|
21
|
+
-->
|
22
|
+
|
23
|
+
## Checklist
|
24
|
+
|
25
|
+
<!--
|
26
|
+
Make sure that you've done all of these. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
|
27
|
+
-->
|
28
|
+
|
29
|
+
- [ ] Upgrade Terraspace: Are you using the latest version of Terraspace? This allows Terraspace to fix issues fast.
|
30
|
+
- [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on StackOverflow.
|
31
|
+
- [ ] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
|
32
|
+
|
33
|
+
## My Environment
|
34
|
+
|
35
|
+
<!-- Please fill out the table below with debugging info to help: -->
|
36
|
+
|
37
|
+
| Software | Version |
|
38
|
+
| ---------------- | ------- |
|
39
|
+
| Operating System | |
|
40
|
+
| Terraform | |
|
41
|
+
| Terraspace | |
|
42
|
+
| Ruby | |
|
43
|
+
|
44
|
+
---
|
45
|
+
|
46
|
+
## Expected Behaviour
|
47
|
+
|
48
|
+
<!--
|
49
|
+
What is it you expected to happen? This should be a description of how the functionality you tried to use is supposed to work. Try to keep this to one-paragraph.
|
50
|
+
-->
|
51
|
+
|
52
|
+
## Current Behavior
|
53
|
+
|
54
|
+
<!--
|
55
|
+
Describe the details of the bug. Try to keep this to one-paragraph.
|
56
|
+
-->
|
57
|
+
|
58
|
+
## Step-by-step reproduction instructions
|
59
|
+
|
60
|
+
<!--
|
61
|
+
Be sure to include any steps you took for the problem to exist. This is likely the longest part of the report.
|
62
|
+
|
63
|
+
Please include any logs you think relevant here. If the logs are long (more than 50 lines) please make a gist of the logs and link to it. https://gist.github.com
|
64
|
+
|
65
|
+
With long logs, you can also use the <details> tag to keep the report readable. Example:
|
66
|
+
|
67
|
+
<details>
|
68
|
+
<summary>Summary Goes Here</summary>
|
69
|
+
|
70
|
+
...this is hidden, collapsable content. start with a blank line to get terminal output to format right...
|
71
|
+
</details>
|
72
|
+
-->
|
73
|
+
|
74
|
+
## Code Sample
|
75
|
+
|
76
|
+
<!--
|
77
|
+
Please provide a code repository, gist, code snippet or sample files to reproduce the issue.
|
78
|
+
-->
|
79
|
+
|
80
|
+
## Solution Suggestion
|
81
|
+
|
82
|
+
<!--
|
83
|
+
Please provide possible solutions. If you can't think of anything, feel free to omit. Please be kind and add helpful possible solutions. For example, "Fix it!" is not a helpful solution suggestion. We are mere mortals. Please be constructive.
|
84
|
+
-->
|