News for hackers. Stuff that matters.
Re:Terraform 0.12 by ivan_ah on Thursday May 23, 2019 @03:33AM (#19989394)
+1 for the question about a "standard" or recommended way to parse and generate .tf files from a script.

I have two use cases in mind: Use case 1: need to have a reproducible way to generate terraform folders for multiple almost-identical deployments (this can be solved via modules) Use case 2: need way to "promote" a deployment from staging to production (load a .tf file, change a few basic params then save again to a different folder --- doesn't really work with templates since I want to load an existing .tf file)

One thing that might work is to use the combination of two tools: - https://github.com/virtuald/pyhcl = reads .tf, can export .tf.json - https://github.com/kvz/json2hcl = convert .tf.json to .tf but feels hacky...

Any other recommendations for .tf parsing and generation? (preferably in python or scriptable via python)

Re:Terraform 0.12 by robfig on Thursday May 23, 2019 @09:25AM (#19991519)
Your favorite tool that produces json should be able to work. I'd probably use jsonnet, which has a multi-file mode so that one template file can render into many json files.