Blog HCP Consul on Azure goes GA, plus more Consul news from HashiConf EU Read more
  • Overview
    • Consul on Kubernetes
    • Control access with Consul API Gateway
    • Discover Services with Consul
    • Enforce Zero Trust Networking with Consul
    • Load Balancing with Consul
    • Manage Traffic with Consul
    • Multi-Platform Service Mesh with Consul
    • Network Infrastructure Automation with Consul
    • Observability with Consul
  • Enterprise
  • Tutorials
  • Docs
  • API
  • CLI
  • Community
GitHub
Download
Try HCP Consul
    • v1.12.x (latest)
    • v1.11.x
    • v1.10.x
    • v1.9.x
    • v1.8.x
  • Commands (CLI)
    • Overview
      • Overview
      • create
      • delete
      • list
      • read
      • update
      • Overview
      • create
      • delete
      • list
      • read
      • update
    • bootstrap
      • Overview
      • create
      • delete
      • list
      • read
      • update
      • Overview
      • create
      • delete
      • list
      • read
      • update
    • set-agent-token
      • Overview
      • clone
      • create
      • delete
      • list
      • read
      • update
    • translate-rules
  • agent
    • Overview
    • datacenters
    • nodes
    • services
    • Overview
    • delete
    • list
    • read
    • write
    • Overview
    • ca
    • proxy
    • envoy
    • expose
    • redirect-traffic
  • debug
  • event
  • exec
  • force-leave
  • info
    • Overview
    • check
    • create
    • delete
    • get
    • list
    • match
  • join
  • keygen
  • keyring
    • Overview
    • delete
    • export
    • get
    • import
    • put
  • leave
  • license
  • lock
  • login
  • logout
  • maint
  • members
  • monitor
    • Overview
    • create
    • delete
    • list
    • read
    • update
    • write
    • Overview
    • area
    • autopilot
    • raft
  • partition
  • reload
  • rtt
    • Overview
    • register
    • deregister
    • Overview
    • agent
    • inspect
    • restore
    • save
    • Overview
    • ca
    • cert
  • validate
  • version
  • watch
Type '/' to Search

»Consul ACL Binding Rules

Command: consul acl binding-rule

The acl binding-rule command is used to manage Consul's ACL binding rules. It exposes commands for creating, updating, reading, deleting, and listing binding rules. This command is available in Consul 1.5.0 and newer.

ACL binding rules may also be managed via the HTTP API.

Note: All of the example subcommands in this document will require a valid Consul token with the appropriate permissions. Either set the CONSUL_HTTP_TOKEN environment variable to the token's secret ID or pass the secret ID as the value of the -token parameter.

»Usage

Usage: consul acl binding-rule <subcommand>

For the exact documentation for your Consul version, run consul acl binding-rule -h to view the complete list of subcommands.

Usage: consul acl binding-rule <subcommand> [options] [args]

  ...

Subcommands:
    create    Create an ACL binding rule
    delete    Delete an ACL binding rule
    list      Lists ACL binding rules
    read      Read an ACL binding rule
    update    Update an ACL binding rule
Usage: consul acl binding-rule <subcommand> [options] [args]

  ...

Subcommands:
    create    Create an ACL binding rule
    delete    Delete an ACL binding rule
    list      Lists ACL binding rules
    read      Read an ACL binding rule
    update    Update an ACL binding rule

For more information, examples, and usage about a subcommand, click on the name of the subcommand in the sidebar.

»Identifying Binding Rules

Several of the subcommands need to operate on a specific binding rule. Those subcommands support specifying the binding rule by its ID using the -id parameter.

When specifying the binding rule by its ID a unique binding rule ID prefix may be specified instead of the entire UUID. As long as it is unique it will be resolved to the full UUID and used.

»Basic Examples

Create a new binding rule:

$ consul acl binding-rule create \
      -method=minikube \
      -bind-type=service \
      -bind-name='k8s-${serviceaccount.name}' \
      -selector='serviceaccount.namespace==default and serviceaccount.name==web'
$ consul acl binding-rule create \
      -method=minikube \
      -bind-type=service \
      -bind-name='k8s-${serviceaccount.name}' \
      -selector='serviceaccount.namespace==default and serviceaccount.name==web'

List all binding rules:

$ consul acl binding-rule list
$ consul acl binding-rule list

Update a binding rule:

$ consul acl binding-rule update -id=43cb72df-9c6f-4315-ac8a-01a9d98155ef \
      -bind-name='k8s-${serviceaccount.name}'
$ consul acl binding-rule update -id=43cb72df-9c6f-4315-ac8a-01a9d98155ef \
      -bind-name='k8s-${serviceaccount.name}'

Read a binding rule:

$ consul acl binding-rule read -id fdabbcb5-9de5-4b1a-961f-77214ae88cba
$ consul acl binding-rule read -id fdabbcb5-9de5-4b1a-961f-77214ae88cba

Delete a binding rule:

$ consul acl binding-rule delete -id b6b856da-5193-4e78-845a-7d61ca8371ba
$ consul acl binding-rule delete -id b6b856da-5193-4e78-845a-7d61ca8371ba
github logoEdit this page
IntroGuidesDocsCommunityPrivacySecurityBrandConsent Manager