I am writing a small converter for NetScaler configuration to equivalent terraform resources.
My design includes an intermediatory step of having .tf.json
ns.conf -> main.tf.json -> main.tf
I have achieved till main.tf.json.
I am looking for a tool to convert my main.tf.json to main.tf before I write on my own.
There is no tool to convert from the JSON syntax to the native syntax, because Terraform accepts the JSON syntax directly. For generated code like this, I would recommend stopping with the solution you already have and letting the JSON output be the final output, passing that generated configuration directly to Terraform.
Terraform accepts the JSON syntax directly specifically so that you don’t need to implement a native syntax generator, and can just use your favorite language’s JSON library instead.