Yaml format secrets

HI,
I an very new to Hashicorp and would love if I could get some guidance on storing the keys in yaml format. Why i would want to do that is I would like to store something like a list whereby when I append a new key in that “list” my consul-template will trigger and continue doing what I intend on doing.

Another thing is that, I can seem to add multiple keys in a secret path. For example i have key in my secret path . In that same path if I put key1 then key is gone and i cant get it.

Please help thank you.

Not understanding the 1st question, 2nd one is because you are overwriting the values, you need to create multiple secret data with keys and values you click add button then you can add more keys and values…

KV engines use yaml to store secrets already … Each secret is a single layer. If you have multiple layers in your yaml you can use Paths in KV and then each final layer would be a secret.

AFA your second issue, this doesn’t seem right. Can you post an example of the actual commands and outputs you’re seeing?
– EDIT – It’s possible you’re trying to append a key? If so then until recently it was the case that, you need to read your secret, append the new key to that secret, and write the whole secret back. With the more recent versions of Vault – you can use: kv patch - Command | Vault by HashiCorp which will append your key/value to an existing secret without overriding.

1 Like

No, they use JSON. Which might be close enough, or not, depending on what features you’re using.

1 Like