consul_acl_token (Resource)

The consul_acl_token resource writes an ACL token into Consul.

Example Usage

# Basic usage

resource "consul_acl_policy" "agent" {
  name  = "agent"
  rules = <<-RULE
    node_prefix "" {
      policy = "read"
    }
    RULE
}

resource "consul_acl_token" "test" {
  description = "my test token"
  policies    = [consul_acl_policy.agent.name]
  local       = true
}

# Explicitly set the `accessor_id`

resource "random_uuid" "test" {}

resource "consul_acl_token" "test_predefined_id" {
  accessor_id = random_uuid.test_uuid.result
  description = "my test uuid token"
  policies    = [consul_acl_policy.agent.name]
  local       = true
}

Schema

Optional

Read-Only

Nested Schema for node_identities

Required:

Nested Schema for service_identities

Required:

Optional:

Nested Schema for templated_policies

Required:

Optional:

Nested Schema for templated_policies.template_variables

Optional:

Import

Import is supported using the following syntax:

terraform import consul_acl_token.anonymous 00000000-0000-0000-0000-000000000002
terraform import consul_acl_token.master-token 624d94ca-bc5c-f960-4e83-0a609cf588be