The acl command is used to interact with Consul's ACLs via the command line. It exposes top-level commands for bootstrapping the ACL system, managing tokens and policies, translating legacy rules, and setting the tokens for use by an agent.
For the exact documentation for your Consul version, run consul acl -h to view the complete list of subcommands.
Usage: consul acl <subcommand> [options] [args]
This command has subcommands for interacting with Consul's ACLs.
Here are some simple examples, and more detailed examples are available
in the subcommands or the documentation.
Bootstrap ACLs:
$ consul acl bootstrap
List all ACL Tokens:
$ consul acl token list
Create a new ACL Policy:
$ consul acl policy create "new-policy" \
-description "This is an example policy" \
-datacenter "dc1" \
-datacenter "dc2" \
-rules @rules.hcl
Set the default agent token:
$ consul acl set-agent-token default 0bc6bc46-f25e-4262-b2d9-ffbe1d96be6f
For more examples, ask for subcommand help or view the documentation.
Subcommands:
bootstrap Bootstrap Consul's ACL system
policy Manage Consul's ACL Policies
set-agent-token Interact with the Consul's ACLs
token Manage Consul's ACL Tokens
translate-rules Translate the legacy rule syntax into the current syntax
For more information, examples, and usage about a subcommand, click on the name of the subcommand in the sidebar or one of the links below: