You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HCL interpolations within dict output contain single quotes #172
Thank you for maintaining this project, it has been a great help for my work!
I think I'm hitting this bug or something similar. I have a Terraform file with stuff like this in it:
SOMETHING_LIST = [for v in values({ for k, v in module.something.or_other : v["x"] => v["y"]... }) : v[0]]
When I parse the file with the hcl2 library it gave me this value:
${[for v in values({ for k, v in module.something.or_other : v["x"] => v["y"]... }) : v[0]]}
I added some code to remove the ${ } stuff and all was well until today, when I noticed the parse result now looks like this:
['${[for v in values({ for k, v in module.something.or_other : v["x"] => v["y"]... }) : v[0]]}']
In other words, I'm getting not only the unwanted ${ } but also an additional [' '] around the parse result.
After digging around and finding a different environment without the problem, I realized that the broken environment had lark 1.1.9 while the working one had lark 1.2.2. So I'm back to the first case with just the ${ } stuff.
Thank you for maintaining this project, it has been a great help for my work!
I think I'm hitting this bug or something similar. I have a Terraform file with stuff like this in it:
SOMETHING_LIST = [for v in values({ for k, v in module.something.or_other : v["x"] => v["y"]... }) : v[0]]
When I parse the file with the hcl2 library it gave me this value:
${[for v in values({ for k, v in module.something.or_other : v["x"] => v["y"]... }) : v[0]]}
I added some code to remove the ${ } stuff and all was well until today, when I noticed the parse result now looks like this:
['${[for v in values({ for k, v in module.something.or_other : v["x"] => v["y"]... }) : v[0]]}']
In other words, I'm getting not only the unwanted ${ } but also an additional [' '] around the parse result.
After digging around and finding a different environment without the problem, I realized that the broken environment had lark 1.1.9 while the working one had lark 1.2.2. So I'm back to the first case with just the ${ } stuff.
I hope this data point is useful.
I think my issue is the same, I will link it here #179 The issue is either here or in the json.dumps of this dict
Activity
weaversam8 commentedon Oct 11, 2024
This is actually true for many different Python datatypes - booleans appear in this output as
TrueandFalseinstead of the Terraformtrueandfalse.Standardize string output from transformer within nested structures t…
eravin-duo commentedon Oct 17, 2024
Thank you for maintaining this project, it has been a great help for my work!
I think I'm hitting this bug or something similar. I have a Terraform file with stuff like this in it:
When I parse the file with the hcl2 library it gave me this value:
I added some code to remove the
${ }stuff and all was well until today, when I noticed the parse result now looks like this:In other words, I'm getting not only the unwanted
${ }but also an additional[' ']around the parse result.After digging around and finding a different environment without the problem, I realized that the broken environment had lark 1.1.9 while the working one had lark 1.2.2. So I'm back to the first case with just the
${ }stuff.I hope this data point is useful.
Standardize string output from transformer within nested structures t…
Rami-Kassouf-FOO commentedon Dec 18, 2024
I think my issue is the same, I will link it here #179 The issue is either here or in the json.dumps of this dict