Vault
Read versioned key/value data
[!IMPORTANT]
Documentation Update: Product documentation, which were located in this repository under/website
, are now located inhashicorp/web-unified-docs
, colocated with all other product documentation. Contributions to this content should be done in theweb-unified-docs
repo, and not this one. Changes made to/website
content in this repo will not be reflected on the developer.hashicorp.com website.
Read versioned data from an existing data path in the kv
v2 plugin.
Assumptions
- You have set up a
kv
v2 plugin. - Your authentication token has
read
permissions for thekv
v2 plugin.
Use vault kv get
to read all the current
key/value pairs on the given path:
$ vault kv get \
-mount <mount_path> \
<secret_path>
For example:
$ vault kv get -mount shared dev/square-api
======= Secret Path =======
shared/data/dev/square-api
======= Metadata =======
Key Value
--- -----
created_time 2024-11-13T21:58:32.128442898Z
custom_metadata <nil>
deletion_time n/a
destroyed false
version 3
===== Data =====
Key Value
--- -----
prod 5678
sandbox 1234
Use the -field
flag to target specific key value pairs on the given path:
$ vault kv get \
-mount <mount_path> \
-field <field_name> \
<secret_path>
For example:
$ vault kv get -mount shared -field prod dev/square-api
5678