Vault
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 kvv2 plugin.
- Your authentication token has createandupdatepermissions for thekvv2 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.434633061Z
custom_metadata    <nil>
deletion_time      n/a
destroyed          false
version            5
