2019-05-01 21:11:23 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-07 18:55:19 +00:00
|
|
|
page_title: 'Commands: ACL Binding Rule Update'
|
2023-01-26 18:42:13 +00:00
|
|
|
description: |
|
|
|
|
The `consul acl binding-rule update` command updates existing ACL binding rules. These rules bind auth methods to specific services or roles.
|
2019-05-01 21:11:23 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul ACL Binding Rule Update
|
|
|
|
|
|
|
|
Command: `consul acl binding-rule update`
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[PUT\] /v1/acl/binding-rule/:id](/consul/api-docs/acl/binding-rules#update-a-binding-rule)
|
2022-01-10 17:40:11 +00:00
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
The `acl binding-rule update` command is used to update a binding rule. The
|
|
|
|
default operations is to merge the current binding rule with those values
|
|
|
|
provided to the command invocation. Therefore to update just one field, only
|
|
|
|
the `-id` option and the option to modify must be provided.
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
| ACL Required |
|
|
|
|
| ------------ |
|
|
|
|
| `acl:write` |
|
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul acl binding-rule update [options] [args]`
|
|
|
|
|
|
|
|
#### Command Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-bind-name=<string>` - Name to bind on match. Can use `${var}`
|
2019-05-01 21:11:23 +00:00
|
|
|
interpolation. This flag is required.
|
|
|
|
|
2023-11-20 14:44:30 +00:00
|
|
|
- `-bind-type=<string>` - Type of binding to perform (`"service"`, `"node"`, `"templated-policy"`, `"policy"` or `"role"`).
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-description=<string>` - A description of the binding rule.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-id=<string>` - The ID of the binding rule to update. It may be specified as a
|
2019-05-01 21:11:23 +00:00
|
|
|
unique ID prefix but will error if the prefix matches multiple binding rule IDs
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-meta` - Indicates that binding rule metadata such as the raft
|
|
|
|
indices should be shown for each entry.
|
2019-05-01 21:11:23 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-no-merge` - Do not merge the current binding rule information with what is
|
2019-05-01 21:11:23 +00:00
|
|
|
provided to the command. Instead overwrite all fields with the exception of the
|
|
|
|
binding rule ID which is immutable.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-selector=<string>` - Selector is an expression that matches against
|
2019-05-01 21:11:23 +00:00
|
|
|
verified identity attributes returned from the auth method during login.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-format={pretty|json}` - Command output format. The default value is `pretty`.
|
2020-03-26 16:03:22 +00:00
|
|
|
|
2019-12-06 16:14:56 +00:00
|
|
|
#### Enterprise Options
|
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
@include 'http_api_partition_options.mdx'
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_namespace_options.mdx'
|
2019-12-06 16:14:56 +00:00
|
|
|
|
2022-07-27 06:17:11 +00:00
|
|
|
#### API Options
|
|
|
|
|
|
|
|
@include 'http_api_options_client.mdx'
|
|
|
|
|
|
|
|
@include 'http_api_options_server.mdx'
|
2021-12-15 01:55:21 +00:00
|
|
|
|
2019-05-01 21:11:23 +00:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Update a binding rule:
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2019-05-01 21:11:23 +00:00
|
|
|
$ consul acl binding-rule update -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890' \
|
|
|
|
-selector 'serviceaccount.namespace==default'
|
|
|
|
Binding rule updated successfully
|
|
|
|
ID: 0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890
|
|
|
|
AuthMethod: minikube
|
|
|
|
Description: wildcard service
|
|
|
|
BindType: service
|
|
|
|
BindName: k8s-${serviceaccount.name}
|
|
|
|
Selector: serviceaccount.namespace==default
|
|
|
|
```
|