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

Fix parsing index field in case of non-numeric string (as allowed in for_each construct), fix sorting #153

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

AndiDog
Copy link
Contributor

@AndiDog AndiDog commented Sep 10, 2020

Resources created with for_each can have string-typed indexes:

resource "aws_route53_record" "subdomains" {
  for_each = toset(["a.domain.de", "b.domain.de", "def.domain.com"])

  [...]
}

Which currently leads to:

Error reading tfstate file: 0.12 format error: json: cannot unmarshal string into Go struct field resourceStateTerraform0dot12.index of type int; pre-0.12 format error: <nil> (nil error means no content/modules found in the respective format)

This PR fixes that and adds a test to ensure computing resources get parsed correctly in such a case.

@pavelpikta
Copy link

@AndiDog big thanks. It's helped me to resolve problem.

@kljensen
Copy link

Would love to see this merged into master and then a release

@adammck adammck merged commit 8b4b0cc into adammck:master Jul 30, 2021
@adammck
Copy link
Owner

adammck commented Jul 30, 2021

Thanks for this PR (and for the bump)! It is included in the v0.10 release.

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.

4 participants