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
Incorrect quoting when parsing list of strings in a tfvars file #286
With the release of version 8.x lists of strings are now double quoted and essentially '"x"' instead of 'x'. This behavior changed this morning in corelation with the 8.10 release. The script was unchanged for 3 years. and yeah... I should have pinned the version of this lib.
I'll harden for it if this is expected but it kind of caused an outage this morning... and I should have pinned the version
Software:
OS: [macOS / Linux] (my laptop and github actions runner
Python version 3.13 (mac) and what ever the standard GHA runner uses
python-hcl2 version 8.10
Snippet of HCL2 code causing the unexpected behaviour:
In an tfvars file we have
members = [
"list",
"of",
"user",
"names"
]
and are essentially doing
with open("../organization/org.auto.tfvars", "r") as file_in:
data = hcl2.load(file_in)
# we have multiple lists but though I would give a fuller context, all 3 lists are basically the above
desired_members = list(set(data['members']) | set(data['admins']) | set(data.get('ncsu_members', [])))
When the new version released this morning, the desired_members list became
['"list"', '"of"', '"user"', '"names"']
When simplifying that set union to a raw 'only hcl2.load` , it's still an issue
This broke some audit automation we had .... which admittedly should have had some more 'too much change protection' this morning .
Expected behavior
The previous behavior with a single set of quotes inline with pep8 guidelines "foo" instead of "'"foo"' (or single ticks... I don't remember the pep8 preference)
Hi @adam-security This is the new expected behavior. However, it can be controlled with this option
Cool, as long as it's expected and thanks for pointing that out....It caused a P1 fire this morning but, I also should have pinned this when I wrote the cleaner script.
Activity
[-]Incorrect quoting in a tfvars file[/-][+]Incorrect quoting when parsing list of strings in a tfvars file[/+]kkozik-amplify commentedon Apr 7, 2026
Hi @adam-security This is the new expected behavior. However, it can be controlled with this option
adam-security commentedon Apr 7, 2026
Cool, as long as it's expected and thanks for pointing that out....It caused a P1 fire this morning but, I also should have pinned this when I wrote the cleaner script.
Add v7-to-v8 migration guide and use absolute GitHub links in README …
Add v7-to-v8 migration guide and use absolute GitHub links in README …
Add v7-to-v8 migration guide and use absolute GitHub links in README …
Add v7-to-v8 migration guide and use absolute GitHub links in README …
strip_string_quotesshould be enabled by default #289 as a duplicate of this issuestrip_string_quotesshould be enabled by default #289 as a duplicate of this issue