Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support .tf.json files #66

Open
jrobison-sb opened this issue Feb 8, 2022 · 2 comments
Open

support .tf.json files #66

jrobison-sb opened this issue Feb 8, 2022 · 2 comments

Comments

@jrobison-sb
Copy link

  • Terraform itself supports .tf.json files, so tfupdate should support them as well. Currently it seems that it does not.
$ cat main.tf
terraform {
  required_version = "0.13.5"
}

$ 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
Copy link
Owner

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants