2019-05-01 18:21:11 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-07 18:55:19 +00:00
|
|
|
page_title: 'Commands: Config Delete'
|
2023-01-26 18:42:13 +00:00
|
|
|
description: >-
|
|
|
|
The `consul config delete` command deletes a configuration entry specified by kind and name.
|
2019-05-01 18:21:11 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul Config Delete
|
|
|
|
|
|
|
|
Command: `consul config delete`
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[DELETE\] /v1/config/:kind/:name](/consul/api-docs/config#delete-configuration)
|
2022-01-10 17:40:11 +00:00
|
|
|
|
2019-05-08 20:19:37 +00:00
|
|
|
The `config delete` command deletes the configuration entry specified by the
|
2023-01-25 16:52:43 +00:00
|
|
|
kind and name. See the [configuration entries docs](/consul/docs/agent/config-entries)
|
2019-05-08 20:19:37 +00:00
|
|
|
for more details about configuration entries.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication). Configuration of
|
|
|
|
[blocking queries](/consul/api-docs/features/blocking) and [agent caching](/consul/api-docs/features/caching)
|
2022-01-10 21:44:56 +00:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
2022-01-11 14:41:54 +00:00
|
|
|
| ACL Required<sup>1</sup> |
|
|
|
|
| ------------------------------------------------------------- |
|
|
|
|
| `service:write`<br />`operator:write`<br />`intentions:write` |
|
|
|
|
|
|
|
|
<sup>1</sup> The ACL required depends on the config entry kind being deleted:
|
|
|
|
|
|
|
|
| Config Entry Kind | Required ACL |
|
|
|
|
| ------------------- | ------------------ |
|
|
|
|
| ingress-gateway | `operator:write` |
|
|
|
|
| proxy-defaults | `operator:write` |
|
|
|
|
| service-defaults | `service:write` |
|
|
|
|
| service-intentions | `intentions:write` |
|
|
|
|
| service-resolver | `service:write` |
|
|
|
|
| service-router | `service:write` |
|
|
|
|
| service-splitter | `service:write` |
|
|
|
|
| terminating-gateway | `operator:write ` |
|
2022-01-10 21:44:56 +00:00
|
|
|
|
2019-05-01 18:21:11 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul config delete [options]`
|
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
#### Command Options
|
2019-05-01 18:21:11 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-kind` - Specifies the kind of the config entry to read.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
2021-05-06 18:04:26 +00:00
|
|
|
- `-name` - Specifies the name of the config entry to delete. The name of the
|
2021-05-04 21:32:07 +00:00
|
|
|
`proxy-defaults` config entry must be `global`, and the name of the `mesh`
|
|
|
|
config entry must be `mesh`.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
2022-07-11 14:13:40 +00:00
|
|
|
- `-filename` - Specifies the file describing the config entry to delete.
|
|
|
|
|
2021-11-01 16:42:01 +00:00
|
|
|
- `-cas` - Perform a Check-And-Set operation. Specifying this value also
|
|
|
|
requires the -modify-index flag to be set. The default value is false.
|
|
|
|
|
|
|
|
- `-modify-index=<int>` - Unsigned integer representing the ModifyIndex of the
|
|
|
|
config entry. This is used in combination with the -cas flag.
|
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
#### Enterprise Options
|
|
|
|
|
|
|
|
@include 'http_api_namespace_options.mdx'
|
|
|
|
|
|
|
|
@include 'http_api_partition_options.mdx'
|
|
|
|
|
|
|
|
#### API Options
|
|
|
|
|
|
|
|
@include 'http_api_options_client.mdx'
|
|
|
|
|
2019-05-01 18:21:11 +00:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
$ consul config delete -kind service-defaults -name web
|
2021-11-01 16:42:01 +00:00
|
|
|
|
|
|
|
$ consul config delete -kind service-defaults -name web -cas -modify-index 26
|
2022-07-11 14:13:40 +00:00
|
|
|
|
|
|
|
$ consul config delete -filename service-defaults-web.hcl
|