3 ms·
Personally I think the custom dsl’s are a bigger issue. I spend a lot of time wrangling tf to have reusable, configurable modules. The more i use tf, the more
by boesboes 4y ago
Personally I think the custom dsl’s are a bigger issue. I spend a lot of time wrangling tf to have reusable, configurable modules.
The more i use tf, the more i think it would be better to remove _all_ dynamic features and use a real language to generate tf configs as flat, static files.
- hackandtrip 4y agoDid you give a try to https://www.terraform.io/cdktf https://www.terraform.io/cdktf ? Unfortunately, it is not stable yet... but we all used Terraform <1.0 for years, and I'd say the experience was never that bad.
- pst 4y agoYes, conditionals and loops in TF are limited and have various annoying and surprising edge cases. But if something is hard to do with the Terraform DSL it's usually a good idea to reconsider if it is really something that one should be doing. We want infrastructure automation to be boring and just work. The risk with general purpose programming languages is that people will always find a way to outsmart themselves. Yes, sure, you can use the testing tool chain of the language of your choosing. But it's not like we have figured out to write software without bugs, despite all the awesomeness of modern languages.
- boesboes 4y agoYeah there is definitly something to be said for having a limited DSL. I feel though the language as-is, has a bit to much dynamic features that kinda half work and then give you completly useless error messages. But tbf, it has gotten alot beter with recent versions. But to explain where I'm coming fromm, this is something I ran into recently: this breaks and returns null if http is not set: lookup(each.value.http, "port", 8080) So I need to do this to make it work: coalesce(lookup(each.value.http, "port"), 8080) Not a huge deal, but just one of these many things over the years where I think don't reinvent the wheel.
- erik_seaberg 4y agoI want both config and code to be concise and clear. “Boring” means it’s unfinished and contains small mistakes that we miss when our eyes glaze over.