-
Notifications
You must be signed in to change notification settings - Fork 107
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
Enhancement/question: generic yaml -> hcl2 converter? #74
Comments
Hi @schollii - at the moment the tool doesn't really read the YAML directly, it uses Kubernetes libraries to parse the YAML into Kubernetes resource objects, and then converts these to HCL. So, supporting YAML to HCL2 would possibly be a bigger change than it might seem. |
I believe you can do this with the Terraform |
The disadvantage of yamldecode (which is very useful for some tasks) is that terraform cannot validate your code. Eg if I have a config.yaml that I use instead of terraform.tfvars, code completion is not available on the values in config.yaml. Luckily terraform can load tfvars in json format which is easy to generate from Python. |
I believe that https://github.com/jrhouston/tfk8s will do what you want. Caveat is it produces output that works with the https://github.com/hashicorp/terraform-provider-kubernetes-alpha provider. |
Any chance k2tf could just be a generic yaml to hcl2 converter? Perhaps a mode flag which causes it to load yaml and just spit out the equivalent HCL2 syntax to stdout.
The text was updated successfully, but these errors were encountered: