DEV Community

Discussion on: Automating your infrastructure deployments

Collapse
 
fedekau profile image
Federico Kauffman

My definition of IaC is "whatever allows me to create/modify resources without clicking around and can be included in version control". That definition is of course personal and you might not agree, but it matches TF.

That being said I agree that TF is more a declarative thing that a "programing" language, but IMO it gets the job done as good as many other tools. In fact I prefer TF rather than things that are more like a programming language (Chef for example).

I believe it often happens that people try to use TF as if it is a programing language and try to do "for loops" or "case" statements or other crazy things, but they shouldn't be doing that, because TF is in fact declarative (according to their site).

Regarding CF vs TF, I think you can achieve the same things with both tools, and IMO they are the most similar tools on the market of IaC.

Collapse
 
krogebry profile image
Bryan Kroger

Yeah, whatever makes the business work, right? I think my big hangup with TF is that it's basically throwing away the last 20 years of programming knowledge in favor of something that avoids "crazy" things like for loops and control statements.

When I use CF, I'm importing JSON chunks into the environment ( usually ruby ), then manipulating the data structures to create an outcome that matches my desired state. With this model I can do things like have isolated stacks of infrastructure, which you can't do with TF.

I like the isolated stacks thing because it allows me to yank an entire stack out of existence without having to worry ( mostly :) ) about artifacts that might be left over. This also allows me to create an entirely new silo of things that I know works together. I don't get that same kind of thing with TF.

Honestly, I'm just baffled that people would choose such an ineloquent solution to such a beautiful problems space as IaC.

Thread Thread
 
fedekau profile image
Federico Kauffman

That is a perfectly valid way of thinking ☺. In some cases I would definetly choose your approach. It is important to know all the possibilities, or at least a good chunk of them.

Cheers 🍻