Recently, we had issues with tfstate being deleted on S3.
As a result, there are a number of EC2 instances still running (duplicates if you will)
Is there a way to query Terraform and list which EC2 instances (and other resources) Terraform has under its control? I want to delete the duplicate AWS resources without messing up Terraform state.
terraform state listand then iterate through that withterraform state show(egterraform state list | xargs terraform state show) to show everything.terraform importis for importing stuff back in to your state which doesn't sound like what you want because it sounds like you've already recreated some things so have duplicates. Also in the future make sure you use state locking to prevent this from happening again! - ydaetskcoR