The consul_acl_role
can be used to manage Consul ACL roles.
resource "consul_acl_policy" "read-policy" {
name = "read-policy"
rules = "node \"\" { policy = \"read\" }"
datacenters = ["dc1"]
}
resource "consul_acl_role" "read" {
name = "foo"
description = "bar"
policies = [
consul_acl_policy.read-policy.id
]
service_identities {
service_name = "foo"
}
}
name
(String) The name of the ACL role.description
(String) A free form human readable description of the role.namespace
(String) The namespace to create the role within.node_identities
(Block List) The list of node identities that should be applied to the role. (see below for nested schema)partition
(String) The partition the ACL role is associated with.policies
(Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used.service_identities
(Block Set) The list of service identities that should be applied to the role. (see below for nested schema)templated_policies
(Block List) The list of templated policies that should be applied to the token. (see below for nested schema)id
(String) The ID of this resource.node_identities
Required:
datacenter
(String) Specifies the node's datacenter.node_name
(String) The name of the node.service_identities
Required:
service_name
(String) The name of the service.Optional:
datacenters
(Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future.templated_policies
Required:
template_name
(String) The name of the templated policies.Optional:
datacenters
(List of String) Specifies the datacenters the effective policy is valid within.template_variables
(Block List, Max: 1) The templated policy variables. (see below for nested schema)templated_policies.template_variables
Optional:
name
(String) The name of node, workload identity or service.Import is supported using the following syntax:
terraform import consul_acl_role.read 816a195f-6cb1-2e8d-92af-3011ae706318