The config/terraform folder is for common configurations. All files in the folder get built and included with the deployed module. Common examples:


Files that end with .tf, .tfvars and .rb get processed with different strategies as part of being built.

Extensions Strategy
.tf and .tfvars Will be processed with ERB. This allows add a little extra power to the Terraform HCL language with templating logic.
.rb Will be processed by the Terraspace Ruby DSL. This allows you to write Terraform code with Ruby.

Note: Files in the files folder are copied straight over to the build cache without any processing regardless of extension. IE: app/stacks/demo/files/example.rb. More docs: Pass Files


The config/terraform is for common configurations. They’re overridable within each module itself, though. For example:

When Terraspace builds the stacks, demo1 uses config/terraform/ and demo2 uses app/stacks/demo2/ Files within the stack have higher precedence than the config/terraform files.

Note, since terraspace provides a little extra power with ERB templating, you can also have dynamic ERB logic in the config/terraform files. It’s up to you, Terraspace gives you options.

The next docs cover different ways to leverage config.

More tools: