Destroy existing Terraform without tfstate

amazon-web-servicesterraform

A developer set up AWS infrastructure on AWS. He then left, without sharing the tfstate file.

We've only stored internal test data so far, so we'd like to tear down the existing infrastructure and start over with a shared state file.

Is there a way to destroy the existing infrastructure automatically using the Terraform configuration, if we do not have the state file? Or do we need to manually delete everything?

Best Answer

I would try out https://github.com/dtan4/terraforming as it can actually dump resources to tfstates.

Another shortcut: grab all resources from aws-cli, run a terraform Import in These, followed by a terraform destroy.

Related Topic