github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/acl/policy/apply.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: acl policy apply'
     4  description: |
     5    The policy apply command is used to create or update ACL policies.
     6  ---
     7  
     8  # Command: acl policy apply
     9  
    10  The `acl policy apply` command is used to create or update ACL policies.
    11  
    12  ## Usage
    13  
    14  ```plaintext
    15  nomad acl policy apply [options] <name> <path>
    16  ```
    17  
    18  The `acl policy apply` command requires two arguments, the policy name and path
    19  to file. The policy can be read from stdin by setting the path to "-".
    20  
    21  This command requires a management ACL token.
    22  
    23  ## General Options
    24  
    25  @include 'general_options_no_namespace.mdx'
    26  
    27  ## Apply Options
    28  
    29  - `-description`: Sets the human readable description for the ACL policy.
    30  
    31  - `-job`: Attaches the policy to the specified job. Requires that `-namespace` is
    32      also set.
    33  
    34  - `-namespace`: Attaches the policy to the specified namespace. Requires that
    35      `-job` is also set.
    36  
    37  - `-group`: Attaches the policy to the specified task group. Requires that
    38      `-namespace` and `-job` are also set.
    39  
    40  - `-task`: Attaches the policy to the specified task. Requires that `-namespace`,
    41      `-job` and `-group` are also set.
    42  
    43  
    44  ## Examples
    45  
    46  Create a new ACL Policy:
    47  
    48  ```shell-session
    49  $ nomad acl policy apply my-policy my-policy.json
    50  Successfully wrote 'my-policy' ACL policy!
    51  ```
    52  
    53  Associate an ACL Policy with a specific task:
    54  
    55  ```shell-session
    56  $ nomad acl policy apply \
    57      -namespace default -job example -group cache -task redis \
    58      my-policy my-policy.json
    59  Successfully wrote 'my-policy' ACL policy!
    60  ```