minamijoyo / tfupdate

Update version constraints in your Terraform configurations
MIT License
539 stars 23 forks source link

support .tf.json files #66

Open jrobison-sb opened 2 years ago

jrobison-sb commented 2 years ago

$ cat main.tf.json { "terraform": { "required_version": "= 0.13.5" } }

$ tfupdate terraform -v 0.14.11 -r ./

$ cat main.tf terraform { required_version = "0.14.11" }

$ cat main.tf.json { "terraform": { "required_version": "= 0.13.5" } }

minamijoyo commented 2 years ago

@jrobison-sb Thank you for your proposal!

It's technically possible, but the current implementation heavily depends on the HCL native syntax. I probably won't prioritize this feature for the foreseeable future, but if someone implement this, I would be happy to review it.

Thanks!

nitrocode commented 1 year ago

As a workaround, a tool like json2hcl could be used to convert the json to hcl, then run tfupdate, and convert back using the dame tool