Open ansgarm opened 2 years ago
I think it should print a better error message, but it should not work. The token could have any value and the serialization to JSON happens with the token as a string, so there could potentially be extra things rendered at execution time that don't match what a user would expect. But yeah we should try to make the error message clearer
Community Note
cdktf & Language Versions
0.10.4
Affected Resource(s)
Debug Output
Expected Behavior
Should work if possible or print a more useful warning (e.g. recommend
Fn.jsonencode()
).Actual Behavior
Fails with
Error: Found an encoded list token string in a scalar string context. Use 'Fn.element(list, 0)' (not 'list[0]') to extract elements from token lists
Steps to Reproduce
Important Factoids
Using
Fn.jsonencode()
works as a workaround.References