4 ms·
You are correct that state is hard to manage, and consequently, the less state you have to manage, the better. The developers of Terraform and Pulumi know this
by zapita 7y ago
You are correct that state is hard to manage, and consequently, the less state you have to manage, the better.
The developers of Terraform and Pulumi know this, but chose to make their tools stateful anyway. That's because if they were stateless, while they would certainly be less of a pain to manage, they would also not be as useful.
For example, without state, the tool wouldn't know what resources it has provisioned in the past. Consequently, it also wouldn't know what resources it can safely remove or modify.
Another example is that, without state, the tool cannot detect when a resource needs to be re-created from scratch, and when it simply needs to be renamed because the operator made a typo in the previous run.
In summary, yes state is hard, but sometimes you just need it to get the job done.