News for hackers. Stuff that matters.
Re:Terraform should have remained stateless by nailer on Saturday May 28, 2022 @02:35AM (#31538096)
Make it so that TF deletes anything not in your config unless whitelisted next question.
Re:Terraform should have remained stateless by moondev on Saturday May 28, 2022 @02:45AM (#31538138)
What about the opposite which is how kubectl works.

"terraform delete" only deletes what is in your config. "terraform apply" only creates and/or updates what is in your config. If you remove a resource from your config after applying it, it's your responsibility to manually delete it.

Re:Terraform should have remained stateless by pharmakom on Saturday May 28, 2022 @03:19AM (#31538291)
Not having to manually delete is one of the reasons I use Terraform. Managing state is much less painful than that would be.
Re:Terraform should have remained stateless by jen20 on Saturday May 28, 2022 @10:13AM (#31540481)
Next question: what if your database is managed by a separate team in the same account? Just delete it eh?
Re:Terraform should have remained stateless by nailer on Saturday May 28, 2022 @06:47PM (#31544541)
Yes. The tool warned you it would do this during the plan phase.
Re:Terraform should have remained stateless by jen20 on Sunday May 29, 2022 @10:38PM (#31554998)
This is absolutely the worst design for a tool imaginable. Any tooling fit for purpose must make peace with the fact that one team, and thus application of a tool, do not own an entire account.
Re:Terraform should have remained stateless by nailer on Monday May 30, 2022 @06:00PM (#31564092)
Ultimately if you’re managing your infrastructure as code you must manage your infrastructure as code. Cattle not pets.