Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not sure why you've had problems with Terraform trying to nuke things - I'd say the planning capability was one of its strong points. A quick glance at the plan will tell you what it needs to remove to put an environment in the expected state (and it's called out again in the destroy count summary at the end of then plan). Terraform doesn't "accidentally" delete things - it's doing it because you've told it they're not needed anymore.


>> Terraform doesn't "accidentally" delete things - it's doing it because you've told it they're not needed anymore.

That's putting it backward to say the least. One never tells terraform that something is not needed anymore. One declares what is needed and terraform will find a way to get there by altering/creating/deleting stuff.

There is a review phase of course and it's very important because it might do anything. Anybody who's had to use terraform can attest that it is scary to run. Any slight error in configuration or state can be tremendously destructive.


>> There is a review phase of course and it's very important because it might do anything. Anybody who's had to use terraform can attest that it is scary to run.

This is no worse than Ansible - if for a set of EC2 instances the user "set to 0 to delete them" then Ansible will blindly do as requested and be just as destructive. On the other hand:

* Terraform does its best to enforce the recommended plan/apply workflow - the plan is always presented before any changes are made, and auto-approval is strongly discouraged.

* There are multiple options for review - do it there and then, or store the plan as an artefact and share with others for review.

* It doesn't matter when you run a stored plan - the plan is the set of changes that will be applied regardless of current state.

* The summary makes very clear if anything is going to be destroyed in bright red text.

Ansible offers some visibility of what it will do with dry runs, although it's not as complete - there's no way to guarantee it will do the same thing next time if changes have been made in the interim.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: