Variables usage is all but clear
az-z opened this issue · 1 comments
az-z commented
Hello,
the usage of env and terrspace vars in the application needs clarity:
For example:
- How can env var be used in stack tf files?
- How can env variable be used in terraform.tfvars file?
- How terraspace specific variables can be accessed in stacks tf files and tfvars?
- What is the rule for using a single vs double quote symbol when referencing a variable?
Here are the examples:
config/app.rb:
Terraspace.configure do |config|
config.cloud.project = "InfraIAC"
end
stack/demo/terraform.tfvars:
aws_region = "<%= expansion(':ENV') %>"
client_abbr = "<%= expansion(":CLIENT_ABBR") %>"
project_abbr = "<%= expansion(':APP') %>"
cached version:
aws_region = "dev"
client_abbr = ":CLIENT_ABBR"
project_abbr = ""
- Consistency in accessing vars:
Can't locate at the moment, but in some parts of the documentation access to vars is:
ENV['FOO']
at others :
"<%= expansion(':ENV') %>"
when to use what is not obvious and not clearly documented.
Not a documentation, but a usage impediment:
the variables used in the code (.tf, rb and tfvars ) and their values should be printed during the "plan" stage, so that a user can inspect their value or absence of it.
tongueroo commented