fix: Use valid syntax for conditionals (#254)#258
fix: Use valid syntax for conditionals (#254)#258kkozik-amplify wants to merge 2 commits intomainfrom
Conversation
* fix: Use valid syntax for conditionals Fix an issue where object literals inside conditional expressions were not rendered correctly, resulting in invalid expresions.
|
Hey @tmccombs |
Maybe I'm misunderstanding what you are saying, but why do you think that? |
|
For example quoted references have been officialy deprecated. Besides that, the library should still transform HCL2 to JSON faithfully without syntactic changes. |
Yeah this might be the case. If you would want to try pushing a fix for this, you could open a new PR to this branch. Otherwise let me know if I should close this PR. |
Do you have a source for that? I wasn't able to find anything. |
|
FWIW, other epxressions with inline objects currently use double quotes as well: >>> import hcl2
>>> hcl2.loads("""
... a {
... x = merge({a = 2, b = "hello"}, var.more)
... }
... """)
{'a': [{'x': '${merge({"a": 2, "b": "hello"}, var.more)}'}]}So, this change isn't really changing anything around that. That said, is there any reason why to_tf_inline doesn't just do something like |

by @tmccombs:
Fix an issue where object literals inside conditional expressions were not rendered correctly, resulting in invalid expresions.