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

Create new values #13

Open
powellchristoph opened this issue May 2, 2019 · 5 comments
Open

Create new values #13

powellchristoph opened this issue May 2, 2019 · 5 comments
Assignees

Comments

@powellchristoph
Copy link

It looks like the tool only lets you get/set existing values and not create new ones.

$ cat test.hcl
foo {
    bar = true
}

$ cat test.hcl | hclq set 'foo.baz' 'this is new'
foo {
  bar = true
}

I would really love to be able to do:

$ cat test.hcl | hclq set 'foo.baz' 'this is new'
foo {
  bar = true
  baz = 'this is new'
}
@powellchristoph
Copy link
Author

Actually, now that I have started using it. I rather like the existing functionality. Closing as no longer required.

@mingfang
Copy link

I need the ability to create new values.
Please reopen.

@mattolenik
Copy link
Owner

Agreed, this would be great! I've started rewriting how values are parsed and set, it doesn't correctly handle all cases. As a consequence of that work, it should be easy to make set add new values as well.

@mattolenik mattolenik reopened this May 20, 2019
@mattolenik mattolenik self-assigned this May 20, 2019
@timstoop
Copy link

I'd really like to see this as well! Any update on the progress?

@mattolenik
Copy link
Owner

I haven't had a chance to try to work this into the current codebase, unfortunately. However, I started working with the HCL2 API, and it simplifies a lot of the things I've been trying to do. Now there's a first-class API for easily manipulating HCL, so I'm starting to rewrite this tool to wrap that functionality with hclq. This rewrite should solve the majority of tricky issues I've had with HCL1.

Unfortunately that does mean dropping HCL1 used by Terraform 0.11, but at this point I don't think it's worth it to continue development with the old language, which is just too hacky.

I'll keep this open until support for HCL2 lands. Stay tuned!

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

4 participants