boltops-tools/terraspace

[FEATURE] Support templating for Pass Files

syepes opened this issue · 0 comments

Summary

Add support for ruby templating with the Terraspace context for specific file under the Pass Files folder

Motivation

Having this extra templating extension .erb would allow the generation of dynamic configuration files based on the terraspace deployment context.
This would allow to have more flexibility with the deployments and have one single solution.

Guide-level explanation

  1. Keep the current supported Pass Files extension functionality untouched (.tf, .tfvars and .rb)
  2. Add support for a new extension like .erb that adds this templating functionality
  3. Any files in config.build.pass_files that match this extension will be processed and all their expansions would be evaluated
  4. When moving the matched .erb files to the final build folder the extra extension fill be removed to keep the original filename. e.g.
config.yaml.erb --> files/config.yaml
config.json.erb --> files/config.json

Reference discussion:

https://community.boltops.com/t/terraform-tfvars-templating-is-not-filled-in/750/5