When I put the first key/value pair to Vault:
vault write secret/item/33 item_name='item_name'
It works well and I get:
vault read secret/item/33
Key Value
--- -----
refresh_interval 768h0m0s
item_name item_name
But if I want put additional field item_type
:
vault write secret/item/33 item_type='item_type'
It overwrites existing one:
vault read secret/item/33
Key Value
--- -----
refresh_interval 768h0m0s
item_type item_type
How to write additional field - key/value pair to Vault without replacing existing ones?
What is a secrets engine? Secrets engines are Vault components which store, generate or encrypt secrets. In Your First Secrets tutorial, you used key/value v2 secrets engine to store data. Some secrets engines like the key/value secrets engine simply store and read data.
The kv secrets engine is a generic Key-Value store used to store arbitrary secrets within the configured physical storage for Vault.
HashiCorp's Vault Enterprise can be used as a flexible, very cost-effective, and scalable external key manager solution. It is certified by NetApp, supports the OASIS KMIP protocol, and integrates with any PKCS #11 compliant HSM.
vault kv put secret/hello foo=world excited=yes even with Key/value v1 you should be able to set multiple as long as you specify both in the same put command.
You can only store one value per key. (Confirmed by Vault developer) Either you think on a data structure that is suitable and write a long string to this key or you are using a single key for each value which could look as follows:
vault write secret/item/33/name item_name='item_name'
vault write secret/item/33/type item_type='item_type'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With