AclToken
The consul..AclToken resource writes an ACL token into Consul.
Example Usage
Basic usage
using Pulumi;
using Consul = Pulumi.Consul;
class MyStack : Stack
{
public MyStack()
{
var agent = new Consul.AclPolicy("agent", new Consul.AclPolicyArgs
{
Rules = @"node_prefix """" {
policy = ""read""
}
",
});
var test = new Consul.AclToken("test", new Consul.AclTokenArgs
{
Description = "my test token",
Local = true,
Policies =
{
agent.Name,
},
});
}
}
Coming soon!
import pulumi
import pulumi_consul as consul
agent = consul.AclPolicy("agent", rules="""node_prefix "" {
policy = "read"
}
""")
test = consul.AclToken("test",
description="my test token",
local=True,
policies=[agent.name])import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";
const agent = new consul.AclPolicy("agent", {
rules: `node_prefix "" {
policy = "read"
}
`,
});
const test = new consul.AclToken("test", {
description: "my test token",
local: true,
policies: [agent.name],
});Create a AclToken Resource
new AclToken(name: string, args?: AclTokenArgs, opts?: CustomResourceOptions);def AclToken(resource_name, opts=None, accessor_id=None, description=None, local=None, namespace=None, policies=None, roles=None, __props__=None);func NewAclToken(ctx *Context, name string, args *AclTokenArgs, opts ...ResourceOption) (*AclToken, error)public AclToken(string name, AclTokenArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args AclTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AclTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AclTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
AclToken Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The AclToken resource accepts the following input properties:
- Accessor
Id string The uuid of the token. If omitted, Consul will generate a random uuid.
- Description string
The description of the token.
- Local bool
The flag to set the token local to the current datacenter.
- Namespace string
The namespace to create the token within.
- Policies List<string>
The list of policies attached to the token.
- Roles List<string>
The list of roles attached to the token.
- Accessor
Id string The uuid of the token. If omitted, Consul will generate a random uuid.
- Description string
The description of the token.
- Local bool
The flag to set the token local to the current datacenter.
- Namespace string
The namespace to create the token within.
- Policies []string
The list of policies attached to the token.
- Roles []string
The list of roles attached to the token.
- accessor
Id string The uuid of the token. If omitted, Consul will generate a random uuid.
- description string
The description of the token.
- local boolean
The flag to set the token local to the current datacenter.
- namespace string
The namespace to create the token within.
- policies string[]
The list of policies attached to the token.
- roles string[]
The list of roles attached to the token.
- accessor_
id str The uuid of the token. If omitted, Consul will generate a random uuid.
- description str
The description of the token.
- local bool
The flag to set the token local to the current datacenter.
- namespace str
The namespace to create the token within.
- policies List[str]
The list of policies attached to the token.
- roles List[str]
The list of roles attached to the token.
Outputs
All input properties are implicitly available as output properties. Additionally, the AclToken resource produces the following output properties:
Look up an Existing AclToken Resource
Get an existing AclToken resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AclTokenState, opts?: CustomResourceOptions): AclTokenstatic get(resource_name, id, opts=None, accessor_id=None, description=None, local=None, namespace=None, policies=None, roles=None, __props__=None);func GetAclToken(ctx *Context, name string, id IDInput, state *AclTokenState, opts ...ResourceOption) (*AclToken, error)public static AclToken Get(string name, Input<string> id, AclTokenState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Accessor
Id string The uuid of the token. If omitted, Consul will generate a random uuid.
- Description string
The description of the token.
- Local bool
The flag to set the token local to the current datacenter.
- Namespace string
The namespace to create the token within.
- Policies List<string>
The list of policies attached to the token.
- Roles List<string>
The list of roles attached to the token.
- Accessor
Id string The uuid of the token. If omitted, Consul will generate a random uuid.
- Description string
The description of the token.
- Local bool
The flag to set the token local to the current datacenter.
- Namespace string
The namespace to create the token within.
- Policies []string
The list of policies attached to the token.
- Roles []string
The list of roles attached to the token.
- accessor
Id string The uuid of the token. If omitted, Consul will generate a random uuid.
- description string
The description of the token.
- local boolean
The flag to set the token local to the current datacenter.
- namespace string
The namespace to create the token within.
- policies string[]
The list of policies attached to the token.
- roles string[]
The list of roles attached to the token.
- accessor_
id str The uuid of the token. If omitted, Consul will generate a random uuid.
- description str
The description of the token.
- local bool
The flag to set the token local to the current datacenter.
- namespace str
The namespace to create the token within.
- policies List[str]
The list of policies attached to the token.
- roles List[str]
The list of roles attached to the token.
Package Details
- Repository
- https://github.com/pulumi/pulumi-consul
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
consulTerraform Provider.