Skip to content

HCL synth: any TOKEN in the serialized object results in wrong output synthesized #3911

Open
@kostyaplis

Description

@kostyaplis

Expected Behavior

Correct HCL generated

Actual Behavior

Incorrect HCL generated

Steps to Reproduce

  1. Create a simple stack that includes variable and a resource that serializes an object with the variable, e.g. IamPolicy.
  2. cdktf synth --> correct JSON output
  3. cdktf synth --hcl --> broken HCL output

gist attached below

Versions

language: typescript
cdktf-cli: 0.21.0
node: v24.3.0
cdktf: 0.21.0
constructs: 10.4.2
jsii: null
terraform: 1.3.10
arch: arm64
os: darwin 24.5.0

Providers

@cdktf/provider-aws (PREBUILT)
terraform provider version: 6.2.0
prebuilt provider version: 21.1.0
cdktf version: ^0.21.0

Gist

https://gist.github.com/kostyaplis/8d109342e6d1f2e71721c133fe9de711

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnewUn-triaged issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions