dtan4 / terraforming

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

Support AWS resource tags with special characters in the key #177

Open robatwave opened 8 years ago

robatwave commented 8 years ago

Trying to import - in my particular case - ELBs created by CloudFormation, I end up with the following in my .tf file wherever it's picked up resource tags:

tags { aws:cloudformation:stack-name = "bla" aws:cloudformation:stack-id = "bla" aws:cloudformation:logical-id = "Balancer" }

When I then run Terraform, I then get something like:

Error loading Terraform: Error loading config: Error parsing /foo/bar.tf: At 44:27: illegal char

... where the char location is the second colon in the first such tag in the file.

The fix, according to the fine people at Hashicorp, should be to wrap the tag keys in double quotes.

robatwave commented 8 years ago

Confirmed in local test that the fix (wrapping tag names in "...") solves the problem at hand