dtan4 / terraforming

Export existing AWS resources to Terraform style (tf, tfstate) / No longer actively maintained
http://terraforming.dtan4.net/
MIT License
4.3k stars 658 forks source link

terraforming ec2 state cannot handle duplicate Name tag #417

Open pkr1234 opened 6 years ago

pkr1234 commented 6 years ago

The EC2 instances have the same "Name" tag. When I run the terraforming command: terraforming ec2 --profile myprofile --tfstate > ./terraform.tfstate

It generates the state file but only for one instance per duplicate Name tag. For example: If two instances are running with Name tag - "My Instance", it will generate one entry in the state file.

pkr1234 commented 6 years ago

Another problem in the command without --tfstate. The code file has duplicate resource names.

Vermyndax commented 5 years ago

If you're using autoscaling, this can be problematic as it will generate static EC2 instances that are not linked to an ASG - they appear to be duplicate EC2 instances that just exist in the environment. Gotta know about this and perform hand surgery, I'm betting.