I'll step in here.
I don't want anyone to construe Armon's comments to mean we're adding
conditionals or "language features" to Terraform's language. Armon was
just trying to understand use cases better.
We're heavily in the camp at HashiCorp that we don't want to build a
programming language into Terraform. If we did, we would've just
embedded a complete language (such as Lua). Instead, we chose to use a
configuration format (libucl), which we further simplified (removed
features) into our own format (HCL). We went one step further and
supported JSON as a complete and first class citizen into the
configuration.
This was a very calculated move.
HCL is our human-friendly configuration piece. JSON is the
machine-generatable configuration piece. Both are completely first
class, both are documented, and both are here to stay.
However, there are features in the configuration language which do
make sense as first class features. One of these is variables. Another
is pulling in default values from environment variables (although this
isn't done yet). Perhaps there is a case to be made for some form of
conditionals, although I'm not yet convinced.
Another example of our hesitation towards complication in the language
is the module system. We wrestled deeply on our side of whether to
introduce some sort of multi-cloud support into modules: having one
module be able to work on AWS, OpenStack, etc. In the end, we decided
for separate modules for each cloud but using directories. For
example:
terraform apply
github.com/hashicorp/consul/terraform/aws
or
terraform apply
github.com/hashicorp/consul/terraform/openstack
That being said, we're not so stubborn or stuck in our ways that we're
closed to new ideas. Armon and I very much welcome these ideas, even
if we have a feeling it isn't something we want. Therefore, I welcome
use cases and examples of where something might be useful.
In the end, we'll come up with some solution to the problem. And maybe
that solution is "use a real PL to generate this configuration in
JSON, because you can" but maybe the use case represents an extremely
common pattern that needs to be solved in Terraform itself. We can't
know unless we listen to our users, and that is what we do here.
So, thank you for all your feedback. We're certainly not making a
decision yet but I hope this shows you where we stand in our thinking
and our process.
Do not fear, HCL will always be what we feel is the minimum required
to hit the real world use cases.
Best,
Mitchell
>
https://groups.google.com/d/msgid/terraform-tool/F6E2AA7F-B84F-451F-ADC4-1F31D0384CA0%40swisscom-labs.com.