0

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?

1
  • you need to delete things manually. Maybe you can script it using awscli or boto if things are tagged correctly. Also could use boto to start at a vpc and find things associated to that.. but it seems quicker to delete by hand
    – Mike
    Aug 6, 2018 at 19:34

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .