Write new key/value data
Write new versions of data to a new or existing data path in the kv
v2 plugin.
Assumptions
- You have set up a
kv
v2 plugin. - Your authentication token has
create
andupdate
permissions for thekv
v2 plugin.
Note
The Vault CLI forcibly converts kv
keys and values data to strings before
writing data. To preserve non-string data, write your key/value pairs to Vault
from a JSON file or use the plugin API.
Use vault kv put
to save a new version of
key/value data to an new or existing secret path:
$ vault kv put \ -mount <mount_path> \ <secret_path> \ <list_of_kv_values>
For example:
$ vault kv put \ -mount shared \ dev/square-api \ sandbox=1234 prod=5679 smoke=abcd ======= Secret Path =======shared/data/dev/square-api ======= Metadata =======Key Value--- -----created_time 2024-11-15T01:52:23.434633061Zcustom_metadata <nil>deletion_time n/adestroyed falseversion 5