Skip to content
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

Stop creating groups for tfstate attribute counts #47

Merged
merged 2 commits into from
Jun 9, 2017

Conversation

Jonnymcc
Copy link
Contributor

terraform-inventory currently creates groups like the following...

{"%_5":["10.95.12.224"],"%_6":["53.81.162.94"], ...

This ensures these groups do not get created.

@adammck
Copy link
Owner

adammck commented Feb 6, 2017

This looks good, but would you mind adding a couple of examples to the fixture in parser_test.go?

resource.go Outdated

switch r.resourceType {
case "aws_instance":
for k, v := range r.Attributes() {
parts := strings.SplitN(k, ".", 2)
if len(parts) == 2 && parts[0] == "tags" && parts[1] != "#" {
if len(parts) == 2 && parts[0] == "tags" && !tf_count.MatchString(parts[1]) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think parts[1] != "#" && parts[1] != "%" would be clearer, here. Could we also get a comment reminding us why we might encounter either symbol? I'm assuming it's a change between Terraform versions.

@adammck adammck merged commit 6f4c1a9 into adammck:master Jun 9, 2017
@adammck
Copy link
Owner

adammck commented Jun 9, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants