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

Doesnt import security groups with non-unique names properly #344

Open myoung34 opened 7 years ago

myoung34 commented 7 years ago

If i have two security groups named foo it will generate duplicate aws_security_group.foo blocks, which cause a non-unique issue in terraform

1 error(s) occurred:

* module root: 1 error(s) occurred:

* aws_security_group.foo: resource repeated multiple times
dtan4 commented 7 years ago

Are the security groups in VPC? If so, Terraforming adds VPC ID as prefix to avoid duplication.

Because I don't have EC2-Classic environments, I can't reproduce the behavior. Is the duplication of Security Group names allowed in EC2-Classic?

myoung34 commented 7 years ago

They are in VPC, and it does prefix them, but you can still have multiple security groups with the same name in AWS (in a vpc or not), but in TF you cant (vpc_a_foo is still a conflict with vpc_a_foo)

dgonzalezruiz commented 7 years ago

This applies to https://github.com/dtan4/terraforming/issues/312 and to every other situation in which a resource can have a similar value for the Name tag.

pkr1234 commented 6 years ago

What's the fix @dtan4 ? This bug is over a year ago.

mhemken-nyt commented 4 years ago

Did this get fixed?