Re:Terraform should have remained stateless
by GeneralMayhem on Saturday May 28, 2022 @02:05AM
(#31537992)
You don't need to store the full old configuration anywhere other than as part of the current configuration. All you need is a list of IDs that existed in previous configurations. Something like:
Depending on your ergonomic preferences, you could also accomplish that by keeping the old table configs and adding an "is_deleted" flag. And once you've done one deploy, you can delete all the old tombstoned configs.
[ Parent
| on HN ]
Re:Terraform should have remained stateless
by jvitor03 on Saturday May 28, 2022 @02:42AM
(#31538127)
Looks like you are creating based on puppet or ansible, not Terraform :)
The whole idea of TF is to not have to declare an absent resource for it to be destroyed, because the declarative approach already have the desired state.
That is a state file by any other name. Terraform could work this way with fairly trivial code changes, and the cost of blowing up provider rate limits during fast incremental development (the kind of places where you set -refresh=false).