Vault
Read subkeys for a key/value data path
[!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 the available subkeys on 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 subkeys on the target secret path.
Use vault read
with the /subkeys
path to retrieve a list of secret data
subkeys at the given path.
$ vault read <mount_path>/subkeys/<secret_path>
Vault retrieves secrets at the given path but replaces the underlying values of
non-map keys and map keys with no underlying subkeys (leaf keys) with nil
.
For example:
$ vault read shared/subkeys/dev/square-api
Key Value
--- -----
metadata map[created_time:2024-11-20T20:00:13.385182722Z custom_metadata:<nil> deletion_time: destroyed:false version:1]
subkeys map[prod:<nil> sandbox:<nil> smoke:<nil>]