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

This is my greatest fear when it comes to terraform:

> terraform destroy

(And either a confirmation or a flag) and everything is deleted.

I know you can add some locks but still :/



You can save yourself from scary operations like deleting everything by a.) not rooting your entire infra in the same main.tf and b.) using Terraform's lifecycle meta-argument: https://www.terraform.io/docs/configuration/resources.html#l...

I like to use the lifecycle feature for suuuper core things that will never be deleted (VPC, r53 zone, etc) and eventually when I start targeting multiple DCs w/ lots of infra I'll eventually move to many state roots (or use tools like Terragrunt, which make things mildly scary again).


Also a human should review every plan and confirm before applying, right?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: