terraspace is a good tool to add more DRY properties to terraform code.
We use development environment name different then “dev”. I can customize other env variables affecting terraspace behavior using ruby hook like this:
class EnvExporter def call ENV['AWS_REGION'] = "..." ENV['AWS_ACCOUNT'] = "..." ENV['TS_ENV'] = "..." end end before("build", execute: EnvExporter, )
but ENV[‘TS_ENV’] = “…” is not loaded in early terraspace stage enough to be used for path, backend, etc.
In “terraspace-0.5.12/lib/terraspace/core.rb” I found also this code setting the default:
def env ENV['TS_ENV'] || "dev" end memoize :env
There is a better way to set this default then changing directly terraspace spec version code in core.rb file (overwritten on every terraspace upgrade and not so maintainable) ?