adammck / terraform-inventory

Terraform State → Ansible Dynamic Inventory
MIT License
1.82k stars 321 forks source link

Support object-like key names #158

Open kljensen opened 3 years ago

kljensen commented 3 years ago

I have a key name for a resource that looks like the following:

aws_route53_record.module_ec2_webserver["www_656_mba"]_the_dns_record

That's because I'm using for_each over an object in my terraform configuration. I'd like to fix the nameParser regexp to handle this case. I can add some tests too. But, I don't have many examples of valid key names "in the wild". I'm hoping people see this issue and can tell me some valid key names and I'll fix the nameParser to recognize them all.

kljensen commented 3 years ago

Here's a playground example https://play.golang.org/p/aUEtalkUyAj