-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Terraform 0.12 state format #114
Conversation
Wow, thanks for delivering this so quickly! I will try to review it this weekend. Please fix the build/tests? Positive/negative feedback from anyone else trying this out is very welcome. |
The build is missing the |
Right now there is a problem with latest version
I have ec2_instance with count=2 Also I have a problem with parsing existing terraform state file
Problem with parsing local tfstate is probably because of different formats of tfstate and |
I'm not sure, but looks like we need to rewrite
|
Saw that coming since I tested simple count-less cases. I can check next week. Any sample snippets and more testing helps, thank you!! |
Please try again now. The pushed patch works in my Terraform project for count=2. |
Works fine, but I got this error message:
main is a name of resource. I.E. aws_ec2_instance.main |
Cannot reproduce that. Do you have a minimal example? |
The patch is working fine when working with terraform modules to group hosts. Unfortunately we are using vpshere-tags to group hosts. This was supported by terraform-inventory prior to 0.12.*. Is there a chance to get this feature back without me having to learn go first? :) Current output of
Expected additional output:
|
As said, please provide a full working example (input + expected output + if possible Terraform 0.12 state file) and it can be tested and fixed hopefully by covering 0.12 with more of the previously existing unit tests. |
Hey, what is the status of this PR? I'm really looking forward to use new dynamic inventory for terraform 0.12 ;) |
It seems like some people are still having trouble with this PR, but it seems useful enough that we ought to merge and release it anyway, perhaps as a pre-release. You're done with this, @AndiDog? |
I have been using the version from this PR for weeks without issue (on AWS). Once the above commenters can provide a reproducible case, they can create separate PRs, since the changes are simple to develop thanks to the unit tests. Please go ahead and merge. I agree that it's already useful now. |
It works for me, but I still have this message even with inventory with a single host. I get this message every time, so I didn't understand how any of my state files can show anything. |
Hi guys, i'm having the same problem with the new Terraform version. Any idea when this PR will be merged? 🙏 |
PR works for me - thanks @AndiDog ! |
I'm still getting the
If you like I can share my |
@dpisano please, read the first message. That version of the terraform works with |
@ctrlok sorry it looks like I was misunderstanding how how to run it. Running just |
As a node this only works when I use it with Ansible when I set |
Can we get this merged and released? Is the PR waiting for anything? |
https://github.com/nbering/terraform-inventory is similar to this project, but is compatible with both Terraform 0.12 and 0.11. https://github.com/nbering/terraform-inventory/blob/master/CHANGELOG.md#200---2019-05-05 |
Nope, this is good to go, I just haven't had time to test it properly. Merging anyway, since it seems to work for plenty of people on this thread. Thanks, @AndiDog! |
FYI this was just released as v0.9. Thanks for your patience! |
Solves #113 by implementing basic support for the output of Terraform 0.12's
terraform show -json
. I introduced new JSON-to-struct mappings for 0.12, but kept all old code to remain compatible with old Terraform versions (99% of people probably still use 0.11 right now). Internally, new-style resources are mapped to the existing struct's so almost no code apart from the parser needed any change.