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

     1  ---
     2  layout: docs
     3  page_title: 'Commands: acl token create'
     4  description: |
     5    The token create command is used to create new ACL tokens.
     6  ---
     7  
     8  # Command: acl token create
     9  
    10  The `acl token create` command is used to create new ACL tokens.
    11  
    12  ## Usage
    13  
    14  ```plaintext
    15  nomad acl token create [options]
    16  ```
    17  
    18  The `acl token create` command requires no arguments.
    19  
    20  ## General Options
    21  
    22  @include 'general_options_no_namespace.mdx'
    23  
    24  ## Create Options
    25  
    26  - `-name`: Sets the human readable name for the ACL token.
    27  
    28  - `-type`: Sets the type of token. Must be one of "client" (default), or
    29    "management".
    30  
    31  - `-global`: Toggles the global mode of the token. Global tokens are replicated
    32    to all regions. Defaults false.
    33  
    34  - `-policy`: Specifies a policy to associate with the token. Can be specified
    35    multiple times, but only with client type tokens.
    36  
    37  - `-role-id`: ID of a role to use for this token. May be specified multiple
    38    times.
    39  
    40  - `-role-name`: Name of a role to use for this token. May be specified multiple
    41    times.
    42  
    43  - `-ttl`: Specifies the time-to-live of the created ACL token. This takes the
    44    form of a time duration such as "5m" and "1h". By default, tokens will be
    45    created without a TTL and therefore never expire.
    46  
    47  ## Examples
    48  
    49  Create a new ACL token linked to an ACL Policy and Role:
    50  
    51  ```shell-session
    52  $ nomad acl token create -name="example-acl-token" -policy=example-acl-policy -role-name=example-acl-role
    53  Accessor ID  = ef851ca0-b331-da5d-bbeb-7ede8f7c9151
    54  Secret ID    = 11d5348a-8768-5baa-6185-c154980e1488
    55  Name         = example-acl-token
    56  Type         = client
    57  Global       = false
    58  Create Time  = 2022-08-23 12:16:09.680699039 +0000 UTC
    59  Expiry Time  = <none>
    60  Create Index = 140
    61  Modify Index = 140
    62  Policies     = [example-acl-policy]
    63  
    64  Roles
    65  ID                                    Name
    66  2fe0c403-4502-e99d-4c79-a2821355e66d  example-acl-policy
    67  ```
    68  
    69  Create a new ACL token with an expiry:
    70  
    71  ```shell-session
    72  $ nomad acl token create -name="example-acl-token" -policy=example-acl-policy -ttl=8h
    73  Accessor ID  = 1b60edc8-e4ed-08ef-208d-ecc18a90ccc3
    74  Secret ID    = e4c7c80e-870b-c6a6-43d2-dbfa90130c06
    75  Name         = example-acl-token
    76  Type         = client
    77  Global       = false
    78  Create Time  = 2022-08-23 12:17:35.45067293 +0000 UTC
    79  Expiry Time  = 2022-08-23 20:17:35.45067293 +0000 UTC
    80  Create Index = 142
    81  Modify Index = 142
    82  Policies     = [example-acl-policy]
    83  
    84  Roles
    85  <none>
    86  ```