3 ms·
I am using Terraform daily, and it's excruciating at times. First, HCL is very limited - HashiCorp didn't even use it for Sentinel! I won't switch to TypeScript
by nikolay 6y ago
I am using Terraform daily, and it's excruciating at times. First, HCL is very limited - HashiCorp didn't even use it for Sentinel! I won't switch to TypeScript either - I wish they've adopted an embedded language like Starlark like in this POC [0].
There are many inconsistencies; refactoring is very, very painful. While `terraform import` and `terraform state mv` work, it's all manual, and the first doesn't work with their SaaS - Terraform Cloud as imports, unlike runs, are always local, but sensitive variables are only available in the cloud. As pointed out, secrets are in plain text - GCP state even had my personal access token, which it's not supposed to as it's not something that has to be shared with the team.
The good thing is that the velocity is greatly improving - we had v0.13 this year, and v0.14 is almost out - many features of v0.15 are done, so that pace compared to v0.12 is new!
My biggest issue is how much copypasta you need for just reusing modules! There's no clean way to do Dependency Inject, and you have to replicate code all over the place as you can't "export" resources or data sources - you can only export primitive values, and then you need to have a data source, which uses that primary key of the resource.
Terraform could turn into a huge, missed opportunity. I hope they realized the potential and that they need to execute fast.
Also, it's very maddening that their prioritization is based on the number of thumbs-ups!
Last but not least - many key providers are run by people who don't follow standards and are working part-time on key projects instead of HashiCorp making sure there's great DX with major vendors. One such example is the GitHub provider. A huge fiasco recently had a backward-incompatible minor release, which also didn't update the docs. After three weeks, the maintainer was still considering unreleasing when people already have found workarounds and reverse-engineered the issues and the missing documentation. Same provider still does not provide organization-level secrets even though this features has been available for more than 6 months!
[0]: https://ascode.run/ https://ascode.run/
- kubanczyk 6y ago> you can only export primitive values That's seriously outdated. The v0.12.0 changelog: "Resource and module object values: An entire resource or module can now be treated as an object value within expressions, including passing them through input variables and output values to other modules, using an attribute-less reference syntax, like `aws_instance.foo`"
- nikolay 6y agoI am well-aware of that and already using, but I don't want to do that - I want to export a reference to it, not a copy of it.