2019-06-10 17:41:55 +00:00
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: kv destroy - Command
|
2019-06-10 17:41:55 +00:00
|
|
|
description: |-
|
|
|
|
The "kv destroy" command permanently removes the specified version data for
|
|
|
|
the provided key and version numbers from the key-value store.
|
|
|
|
---
|
|
|
|
|
|
|
|
# kv destroy
|
|
|
|
|
2020-01-22 20:05:41 +00:00
|
|
|
~> **NOTE:** This is a [K/V Version 2](/docs/secrets/kv/kv-v2) secrets
|
2019-06-10 17:41:55 +00:00
|
|
|
engine command, and not available for Version 1.
|
|
|
|
|
2019-09-11 13:20:49 +00:00
|
|
|
The `kv destroy` command permanently removes the specified versions' data
|
2019-06-10 17:41:55 +00:00
|
|
|
from the key/value secrets engine. If no key exists at the path, no action is
|
|
|
|
taken.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Destroy version 11 of the key "creds":
|
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2022-06-15 23:07:50 +00:00
|
|
|
$ vault kv destroy -mount=secret -versions=11 creds
|
2019-06-10 17:41:55 +00:00
|
|
|
Success! Data written to: secret/destroy/creds
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2020-01-22 20:05:41 +00:00
|
|
|
There are no flags beyond the [standard set of flags](/docs/commands)
|
2019-06-10 17:41:55 +00:00
|
|
|
included on all commands.
|
|
|
|
|
|
|
|
### Output Options
|
|
|
|
|
|
|
|
- `-format` `(string: "table")` - Print the output in the given format. Valid
|
|
|
|
formats are "table", "json", or "yaml". This can also be specified via the
|
|
|
|
`VAULT_FORMAT` environment variable.
|
|
|
|
|
|
|
|
### Command Options
|
|
|
|
|
2022-06-15 23:07:50 +00:00
|
|
|
- `-mount` `(string: "")` - Specifies the path where the KV backend is mounted.
|
|
|
|
If specified, the next argument will be interpreted as the secret path. If
|
|
|
|
this flag is not specified, the next argument will be interpreted as the
|
|
|
|
combined mount path and secret path, with /data/ automatically inserted for
|
|
|
|
KV v2 secrets.
|
|
|
|
|
2019-06-10 17:41:55 +00:00
|
|
|
- `-versions` `([]int: <required>)` - The versions to destroy. Their data will
|
2020-01-18 00:18:09 +00:00
|
|
|
be permanently deleted.
|