Destroy one resource
Destroy one resource and leave everything else alone
terraform destroy -target=module.vpc.aws_vpc.main
More terraform commands
-
terraform taint module.eks.aws_instance.nodeMark a resource for replacement on the next apply
-
terraform state rm module.path.resource_type.nameForget a resource in state without destroying it in the cloud
-
terraform refresh -var-file=prod.tfvarsUpdate the state file to match the real infrastructure
-
terraform graph | dot -Tsvg > graph.svgDraw the resource dependency graph as SVG (needs Graphviz)
-
terraform state list | grep <pattern>Filter the resources in state by a pattern