-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
In contexts where a map or object is part of an hcl expression, the load or loads function will deserialize as an invalid interpolation.
Software:
- OS: linux
- Python version: 3.13 6
- python-hcl2 version: 7.3.1
Snippet of HCL2 code causing the unexpected behaviour:
locals {
foo = var.a ? { id = 1 } : null
}Expected behavior
I expect to get back a valid hcl expression for local.foo, something like
"${var.a ? {id = 1} : null}"
** Actual behavior**
but instead hcl2.load gives me:
```python
"${var.a ? {'id': 1} : null}"Notice how the object is setialized like a python dict, not an hcl object.
Then if I try to use reverse_tranaform on it, I get an exception about an unexpected token for the "'".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working