by m1keil · 4y ago · 0 comments
Ansible, Chef, Puppet and co existed long before Terraform. If the stateless way would work better, these tools take over the cloud infrastructure space. But they didn't. To me it seems like a good sign that the their approaches didn't fit to infra.
Additionally, one of the biggest terraform selling points in the early days was the change plan feature. The ability to see the entire change that is about to happen as a result of a config change. I don't think it's easy to implement such thing in a stateless system.
Is it possible to create a stateless config for a subset of the resources/providers with a better functionality? Absolutely! Octodns seems like a good example. Another great example would be any of the serverless frameworks out there that do a much better job than Terraform at managing the lifecycle of the functions. But can this approach be applied to every provider and resource?
The tools are not comparable in what they do.
These are in use but far cry away from popularity of tools such as Terraform, Cloudformation and others.
Terraform defines and end-state and uses dependencies between resources to reach that state. Removing a resource from a tf file will remove it from the infra.
Ansible, Puppet, etc. don’t have intermediate stores of the hosts’ configuration, but then again they are used for different things.
Ansible and Puppet are not used anymore because of the shift to cloud native, not because they are stateless.
TF's success, in my opinion, can be boiled down to:
a) Having a state - allowed them to provide declarative config with plan functionality
b) Choosing Go - removed the burden of installing or having to invest in self contained setup like they did with Vagrant & ruby.
I'm not a TF zealot. I hate my life every time I need to use it. And yet I know that there are no better alternatives out there. I'm sure there are some nice things in Pulumi or cdk-tf but I doubt switching to any worth the investment with existing TF project.
I would be glad to try and play with a tf-like project that works without state - "talk is cheap, show me the code".