Terraform 0.12 language looks bad (2018)
Tags: rant, systemadministratio, ansible, puppet
Published: 2020-04-03 07:36:43

---
title: Terraform 0.12 language looks bad (2018)
published: true
date: 2018-07-13 06:45:07 UTC
tags: Rant,System administratio,ansible,puppet
canonical_url: https://ilya-sher.org/2018/07/13/terraform-0-12-language-looks-bad/
---

I was [hoping](https://ilya-sher.org/2018/06/30/terraform-becomes-a-programming-language/) that smart guys vs bad situation will have another outcome but [Terraform language for version 0.12](https://www.hashicorp.com/blog/hashicorp-terraform-0-12-preview-for-and-for-each) looks bad… as languages of Puppet and Ansible.

I’m not saying that people that made Puppet and Ansible are not smart. It’s that we could learn from the mistakes they made… unless we don’t consider those being mistakes.

Puppet and Ansible went through very similar difficult situation. They have limited themselves to a declarative format and then they tried to accommodate the real life. Terraform has this situation right now.

The situation is:

- Declarative format being used
- People need something more powerful, like a programming language because … real life where conditionals, loops and data transformations make much more sense than working around declarative languages limitations.

Interestingly enough, they all did not switch to a proper programming language. Maybe because that would be at least partially admitting that **the product should have been a library in the first place**?

Terraform is actually in very crappy situation because even if they decide to expose everything as a library as the main interface, I don’t see people start using Go for “infrastructure as code”. Not as smooth as Ruby or Python anyway.

Happy coding, everyone!

**Update (2018-07-21):**

On a bit more positive note, [the new splat operator](https://www.hashicorp.com/blog/terraform-0-12-generalized-splat-operator) looks like an improvement.

**Update (2018-07-27):**

Terraform looks even more like a “normal” language with [Conditional Operator Improvements](https://www.hashicorp.com/blog/terraform-0-12-conditional-operator-improvements) and `null` value. The conditional operator fixes previous oddities that it had.

**Update (2018-08-02):**

Terraform got [type system](https://www.hashicorp.com/blog/terraform-0-12-rich-value-types). Looks powerful. Just need to see that Terraform does not evolve to Scala ![🙂](https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png)

**Update (2018-08-11):**

New [template syntax](https://www.hashicorp.com/blog/terraform-0-12-template-syntax) brings more raw power. Looks good.

**Update (2018-08-26):**

- HCL to JSON [one-to-one mapping](https://www.hashicorp.com/blog/terraform-0-12-reliable-json-syntax). When I read “having a clean 1:1 mapping between HCL and JSON, and ensuring every feature of HCL is supported in JSON” I immediately thought that there must be converting tools then… and was not disappointed ![🙂](https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png) “In future versions of Terraform, we will also support native tooling to convert HCL to JSON and JSON to HCL cleanly (including comments)”
- “Comments in JSON” – nice!