by pst · 4y ago · 0 comments
current_tables {
TableA {
Column1[string]
Column2[bool]
}
}
removed_tables: ["TableOld", "AnotherOldTable", ...]
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.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.
And this is only during incremental adoption, where you'd soft-delete resources in your config by switching them to tombstones instead of removing them entirely, and adding tombstones for legacy unmanaged resources you want to remove (which builds up a nice history of those removals).
Once that's done, switch to "omnipresent" mode, delete all the tombstones, and never worry about them or state again.