hcl2json
hcl2json copied to clipboard
tftest.hcl command conversion
I have file with test sth.tftest.hcl:
run "test_nothing" {
command = plan
}
I attempt to convert it to json: and i get:
{
"run": {
"test_nothing": [
{
"command": "${plan}"
}
]
},
}
when I try to run terraform test on first version it's fine but when i try to run it on json version it errors with:
│ Error: Invalid "command" keyword
│
│ on tests-out/sth.tftest.json line 5, in run.test_nothing[0]:
│ 5: "command": "${plan}"
│
│ The "command" argument requires one of the following keywords without
│ quotes: apply or plan.
Is this hcl2json conversion issue or terraform issue?
It's a "accurately converting hcl to json in all cases requires knowledge of the schema" problem.
This is basically the same problem as https://github.com/tmccombs/hcl2json/issues/12