consul/website/source/docs/commands/intention/create.html.md.erb

52 lines
1.2 KiB
Plaintext

---
layout: "docs"
page_title: "Commands: Intention Create"
sidebar_current: "docs-commands-intention-create"
---
# Consul Intention Create
Command: `consul intention create`
The `intention create` command creates or updates an intention.
## Usage
Usage: `consul intention create [options] SRC DST`
Usage: `consul intention create [options] -f FILE...`
#### API Options
<%= partial "docs/commands/http_api_options_client" %>
#### Intention Create Options
* `-allow` - Set the action to "allow" for intentions. This is the default.
* `-deny` - Set the action to "deny" for intentions. This cannot be specified
with `-allow`.
* `-file` - Read intention data one or more files specified by the command
line arguments, instead of source/destination pairs.
* `-meta key=value` - Specify arbitrary KV metadata to associate with the
intention.
* `-replace` - Replace any matching intention. The replacement is done
atomically per intention.
## Examples
Create an intention `web => db`:
$ consul intention create web db
Create intentions from a set of files:
$ consul intention create -file one.json two.json
Create intentions from a directory using shell expansion:
$ consul intention create -file intentions/*.json