3 ms·
I'll consider this a variation on moving state elsewhere. Now you have to keep the deleted resource forever. Or keep track of which environments the version w
by aayjaychan 4y ago
I'll consider this a variation on moving state elsewhere. Now you have to keep the deleted resource forever. Or keep track of which environments the version with the removal directive is deployed to, or risk having orphaned resources in different environments.
- ratww 4y ago> Now you have to keep the deleted resource forever Not really. In every other system you can remove tombstones after a while.
- Too 4y agoNot much different from how DB migration scripts are managed when using ORMs.
- rwiggins 4y agoFair enough. It does at least let you continue to use the same commands/tooling. But anyway, agreed, I think the stateful status quo is the way to go.
- GeneralMayhem 4y agoIt's not that bad as long as you have a reasonable deployment process. If you can't rely on your production state being fairly up to date relative to the Terraform definition, then you've got bigger problems than dealing with TF statefulness. If you know that TF changes are guaranteed to be deployed within X days of writing them (e.g., with something like Atlantis, or even a weekly deployment schedule), then you can put a date in the comment of when the tombstone was added, and clean it up either automatically after X days or occasionally in a semi-automated sweep.
- aayjaychan 4y agoI agree having production updated frequently is ideal, but sometimes we don't get to choose when things are deployed when working with external clients. I'm glad Terraform doesn't dictate the workflow, so that we can fix one thing at a time.